ok for  serials, now i can extract from psql (\d tablename).

But i'm not able to extract foreign keys from the schema.



>From: Joel Burton <jburton@scw.org>
>To: "V. M." <txian@hotmail.com>
>CC: pgsql-hackers@postgresql.org
>Subject: Re: unanswered: Schema Issue
>Date: Thu, 26 Apr 2001 13:51:26 -0400 (EDT)
>
>On Thu, 26 Apr 2001, V. M. wrote:
>
> >
> > I want to extract tables schema information, i've looked at
> > src/bin/psql/describe.c  but i cannot determine the datatype
> > 'serial' and
> > 'references' from pg_*, i understand that triggers are generated for
> > serial
> > and references, so how i can understand from my perl application the
> > full
> > schema ?
>
>SERIALs are just integers (int4). They don't use a trigger, but use a
>sequence
>as a default value.
>
>REFERENCES are not a type of data, but a foreign key/primary key
>relationship. There's still a data type (int, text, etc.)
>
>You can derive schema info from the system catalogs. Use psql with -E for
>examples, or look in the Developer Manual.
>
>HTH,
>
>--
>Joel Burton   <jburton@scw.org>
>Director of Information Systems, Support Center of Washington
>

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


Thu, 26 Apr 2001 20:04:14 +0200
"V. M." <txian@hotmail.com>
Re: unanswered: Schema Issue
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@scw.org>
Director of Information Systems, Support Center of Washington


Thu, 26 Apr 2001 14:42:31 -0400 (EDT)
Joel Burton <jburton@scw.org>
Re: unanswered: Schema Issue