Search Postgresql Archives

Re: lack of consequence with domains and types

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

 



On Fri, Dec 26, 2008 at 3:57 PM, Grzegorz Jaśkiewicz <gryzman@xxxxxxxxx> wrote:> another glance at source code, and docs tells me - that there's not> such thing as default value for custom type - unless that type is> defined as new base scalar type. So probably, that would require> postgresql to allow users to define default values for composite types> as well, like that:> create type foo AS> (>  a int default 1,>  b foodomain default 'foo',> ....> );
don't forget, you can create types via create table:
create table foo as(  a int default 1,  ...  check (a<5));
create table bar(f foo);insert into bar default values; -- should foo defaults fire?? I sayprobably, but check constraints should definately be enforced(currently they are not).
(since you can alter the table later, there is very little reason notto create types with create table always).
merlin
-- 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