"Named" column default expression

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: "Named" column default expression
Date: 2011-10-28 07:29:49
Message-ID: j8dlju$4g9$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I just noticed that Postgres allows the following syntax:

create table foo
(
id integer constraint id_default_value default 42
);

But as far as I can tell the "constraint id_default_value" part seems to be only syntactical sugar as this is stored nowhere. At least I couldn't find it going through the catalog tables and neither pg_dump -s or pgAdmin are showing that name in the generated SQL source for the table.

It's not important, I'm just curious why the syntax is accepted (I never saw a default value as a constraint) and if there is a way to retrieve that information once the table is created.

Thanks
Thomas

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Radosław Smogura 2011-10-28 07:53:57 Re: Server hitting 100% CPU usage, system comes to a crawl.
Previous Message Mohamed Hashim 2011-10-28 07:02:03 Performance Problem with postgresql 9.03, 8GB RAM, Quadcore Processor Server--Need help!!!!!!!