Skip site navigation (1) Skip section navigation (2)

Re: Re: unanswered: Schema Issue

From: "V(dot) M(dot)" <txian(at)hotmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: jburton(at)scw(dot)org
Subject: Re: Re: unanswered: Schema Issue
Date: 2001-04-26 19:24:02
Message-ID: F189QYx3G5aYY61LEdy000038af@hotmail.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
perhaps adding  t.tgargs to your view enable me to extract parameters
that are the related fields
---------------------------------------


CREATE VIEW dev_ri
                AS
                SELECT  ***** t.tgargs **** , t.oid as trigoid,
                    c.relname as trig_tbl,
                    t.tgfoid,
                    f.proname as trigfunc,
                    t.tgenabled,
                    t.tgconstrname,
                    c2.relname as const_tbl,
                    t.tgdeferrable,
                    t.tginitdeferred
                    FROM pg_trigger t,
                    pg_class c,
                    pg_class c2,
                    pg_proc f
                    WHERE t.tgrelid=c.oid
                    AND t.tgconstrrelid=c2.oid
                    AND tgfoid=f.oid
                    AND tgname ~ '^RI_'
                    ORDER BY t.oid;


a tgargs example is:

fk_provincie_id_paesi_id_provin\000paesi\000province\000UNSPECIFIED\000id_provincia\000id\000

first field (fk_provincie_id_paesi_id_provin) is constraint name, and i can 
understand that:  paesi(id_provincia) references provincia(id).

valter




>From: Joel Burton <jburton(at)scw(dot)org>
>To: "V. M." <txian(at)hotmail(dot)com>
>CC: pgsql-hackers(at)postgresql(dot)org
>Subject: [HACKERS] Re: unanswered: Schema Issue
>Date: Thu, 26 Apr 2001 14:42:31 -0400 (EDT)
>
>On Thu, 26 Apr 2001, V. M. wrote:
>
> > ok for  serials, now i can extract from psql (\d tablename).
> >
> > But i'm not able to extract foreign keys from the schema.
>
>Yes you can. Read my tutorial on Referential Integrity in the top section
>at techdocs.postgresql.org.
>
>--
>Joel Burton   <jburton(at)scw(dot)org>
>Director of Information Systems, Support Center of Washington
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


Responses

pgsql-hackers by date

Next:From: Joel BurtonDate: 2001-04-26 19:32:47
Subject: Re: [HACKERS] Re: unanswered: Schema Issue
Previous:From: V. M.Date: 2001-04-26 19:12:14
Subject: Re: Re: unanswered: Schema Issue

pgsql-general by date

Next:From: Gregory WoodDate: 2001-04-26 19:25:37
Subject: Re: help with serial type
Previous:From: Gregory WoodDate: 2001-04-26 19:19:39
Subject: Re: help with serial type

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group