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 29453529A8 for ; Wed, 3 Aug 2005 14:23:47 -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 18774-10 for ; Wed, 3 Aug 2005 17:23:45 +0000 (GMT) Received: from web34205.mail.mud.yahoo.com (web34205.mail.mud.yahoo.com [66.163.178.120]) by svr1.postgresql.org (Postfix) with SMTP id C00A752913 for ; Wed, 3 Aug 2005 14:23:43 -0300 (ADT) Received: (qmail 70350 invoked by uid 60001); 3 Aug 2005 17:23:43 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=zESDpjRtBP1k8ghoGa7oKBOtyNwGgBWh/A+G8YGyuoVwESwX8s5s0nBn+Vj5pUqYQpIkhxmi3Vq8rKSNeRCe7m5GMVAEtHWAqnBY4pLWvDGXZTeOT/iV1xYlU1p9YZoCRpJ0lx7yWOy8ni8P/v5OUoIvLIK+1rnuz4nWlibLocw= ; Message-ID: <20050803172343.70348.qmail@web34205.mail.mud.yahoo.com> Received: from [209.21.108.34] by web34205.mail.mud.yahoo.com via HTTP; Wed, 03 Aug 2005 10:23:43 PDT Date: Wed, 3 Aug 2005 10:23:43 -0700 (PDT) From: Hemapriya Subject: Re: Help converting constraint triggers To: Chris Hoover , pgsql-admin@postgresql.org In-Reply-To: <1d219a6f05080309243afb2e00@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.69 tagged_above=0 required=5 tests=FORGED_YAHOO_RCVD, FROM_ENDS_IN_NUMS X-Spam-Level: ** X-Archive-Number: 200508/40 X-Sequence-Number: 18359 pgAdmin III v1.2.0.. --- Chris Hoover wrote: > 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: > > > > pgadmin will list all the trigger functions > defined > > in each schema. it is a freeware. > > > > --- Chris Hoover wrote: > > > > > 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 > > > > > > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > protection around > > http://mail.yahoo.com > > > > ---------------------------(end of > broadcast)--------------------------- > TIP 6: explain analyze is your friend > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com