Re: Can I get the default value for an attribute ( field) ? - Mailing list pgsql-general

From ADBAAMD
Subject Re: Can I get the default value for an attribute ( field) ?
Date
Msg-id 3AC8C103.20302@bell.ca
Whole thread Raw
In response to RE: Can I get the default value for an attribute (field) ?  (Mike Mascari <mascarm@mascari.com>)
List pgsql-general
Mike Mascari wrote:

> If you start psql with the -E option you'll see it generates a query
> similar to the following:
>
> SELECT substring(d.adsrc for 128) FROM pg_attrdef d, pg_class c
> WHERE c.relname = 'my_table' AND c.oid = d.adrelid NAD d.adnum = X
>
> where my_table is the table in question and X is the column number
> within that table.

    Is there a way to do it in the properly relational way, I mean, using
attribute (column) name instead of a number?




--
  _
/ \   Leandro Guimarães Faria Corsetti Dutra         +55 (11) 3040 8913
\ /   Amdocs at Bell Canada                          +1 (514) 786 87 47
  X    Support Center, São Paulo, Brazil          mailto:adbaamd@bell.ca
/ \   http://terravista.pt./Enseada/1989/    mailto:leandrod@amdocs.com



pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Need PostgreSQL startup scripts
Next
From: Soma Interesting
Date:
Subject: compile error