--
-- acs_mail_gc_object__new/6
--
create or replace function acs_mail_gc_object__new(
  integer,
  character varying,
  timestamp with time zone,
  integer,
  character varying,
  integer
) returns int4 as $$

declare
    p_gc_object_id  alias for $1;    -- default null
    p_object_type   alias for $2;    -- default acs_mail_gc_object
    p_creation_date alias for $3;    -- default now
    p_creation_user alias for $4;    -- default null
    p_creation_ip   alias for $5;    -- default null
    p_context_id    alias for $6;    -- default null
    v_object_id   integer;
begin
    v_object_id := acs_object__new (
		p_gc_object_id,		-- object_id 
		p_object_type,		-- object_type 
		p_creation_date,	-- creation_date 
		p_creation_user,	-- creation_user 
		p_creation_ip,		-- creation_ip 
		p_context_id		-- context_id 
    );

    insert into acs_mail_gc_objects values ( v_object_id );

    return v_object_id;
end;
$$ language plpgsql;