Search Postgresql Archives

Re: lack of consequence with domains and types

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

 



gj=# create domain dfoo as varchar(20) default 'bollocks' not null;
CREATE DOMAIN
Time: 1680,908 ms

gj=# create table foo( a bigserial not null, b int default
(random()*100)::int not null );
NOTICE:  CREATE TABLE will create implicit sequence "foo_a_seq" for
serial column "foo.a"
CREATE TABLE
Time: 899,848 ms

gj=# insert into foo(b) select generate_series(1, 10);
INSERT 0 10
Time: 138,247 ms

gj=# alter table foo add column c dfoo not null;
ALTER TABLE
Time: 351,059 ms

gj=# select * from foo order by random() limit 1;
 a | b |    c
---+---+----------
 3 | 3 | bollocks
(1 row)

Time: 114,236 ms


I _Do_ understand domains very well. Thing is, why the same thing
won't happen if I include that domain in type!!!

-- 
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