Re: Can I get the default value for an attribute ( field) ?

From: "ADBAAMD" <adba(dot)amdocs(at)bell(dot)ca>
To: "mascarm(at)mascari(dot)com" <mascarm(at)mascari(dot)com>
Cc: "'Joel Burton'" <jburton(at)scw(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Can I get the default value for an attribute ( field) ?
Date: 2001-04-02 18:12:19
Message-ID: 3AC8C103.20302@bell.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)bell(dot)ca
/ \ http://terravista.pt./Enseada/1989/ mailto:leandrod(at)amdocs(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel ?erud 2001-04-02 18:23:35 What could be the reason for EXTREMELY slow INSERTs?
Previous Message Soma Interesting 2001-04-02 18:03:38 compile error