X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 141AF528C0 for ; Wed, 3 Aug 2005 13:24:25 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 04169-06 for ; Wed, 3 Aug 2005 16:24:16 +0000 (GMT) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.205]) by svr1.postgresql.org (Postfix) with ESMTP id EFF725285D for ; Wed, 3 Aug 2005 13:24:15 -0300 (ADT) Received: by zproxy.gmail.com with SMTP id 8so96398nzo for ; Wed, 03 Aug 2005 09:24:15 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=M6Wfw9q09QfG5b4CZsagCyeoNcaaaoMwP7j3MtNBKscTTHyuhmVEY5b1g9irbh7FmrJ+jkBKjYhvkwtqZKQwAg3s5UcGx8cjkHGjQsE6uX1qsRhlt8DiNXJHZY+nlMdrezQFW6LBQxNu7gNCuVk5JAC6D9Y3jMCw7EnK9DO6b4o= Received: by 10.37.20.51 with SMTP id x51mr207873nzi; Wed, 03 Aug 2005 09:24:14 -0700 (PDT) Received: by 10.36.25.14 with HTTP; Wed, 3 Aug 2005 09:24:14 -0700 (PDT) Message-ID: <1d219a6f05080309243afb2e00@mail.gmail.com> Date: Wed, 3 Aug 2005 12:24:14 -0400 From: Chris Hoover To: Hemapriya , pgsql-admin@postgresql.org Subject: Re: Help converting constraint triggers In-Reply-To: <20050803154814.33480.qmail@web34204.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1d219a6f05080308271131c8d9@mail.gmail.com> <20050803154814.33480.qmail@web34204.mail.mud.yahoo.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.024 tagged_above=0 required=5 tests=RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200508/37 X-Sequence-Number: 18356 What version of pgadmin are you using? I looked in pgadmin3 and it does not show the constraint triggers. On 8/3/05, Hemapriya wrote: >=20 > pgadmin will list all the trigger functions defined > in each schema. it is a freeware. >=20 > --- Chris Hoover wrote: >=20 > > I need some help understanding how to convert > > constraint triggers to > > normal foreign keys. I have several of them in my > > database that a > > previous dba created. Since they don't show up in > > most PostgreSQL > > tools, they are becoming a real pain to deal with. > > > > Here is an example of on of the constraint triggers: > > CREATE CONSTRAINT TRIGGER sys_user_group_id_fkey > > AFTER INSERT OR UPDATE ON sys_user > > FROM sys_group > > NOT DEFERRABLE INITIALLY IMMEDIATE > > FOR EACH ROW > > EXECUTE PROCEDURE "RI_FKey_check_ins" > > ('sys_user_group_id_fkey', > > 'sys_user', 'sys_group', 'UNSPECIFIED', 'group_id', > > 'group_id'); > > > > > > I believe this is the same as the foriegn key > > definition, > > > > alter table sys_user > > add constraint sys_user_group_id_fkey foreign > > key(group_id) > > references sys_group(group_id) > > not deferrrable; > > > > Is this correct? If not, how would be proper > > foreign key be defined? > > > > Thanks, > > > > Chris > > > > ---------------------------(end of > > broadcast)--------------------------- > > TIP 5: don't forget to increase your free space map > > settings > > >=20 >=20 > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com >