Search Postgresql Archives

"Named" column default expression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux