Skip site navigation (1) Skip section navigation (2)

Re: lack of consequence with domains and types

From: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
To: "Erik Jones" <ejones(at)engineyard(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: lack of consequence with domains and types
Date: 2008-12-25 13:19:15
Message-ID: 2f4958ff0812250519j1dcc5d1dr88258f34ef61cc01@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
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!!!

In response to

Responses

pgsql-general by date

Next:From: Asko OjaDate: 2008-12-25 13:23:22
Subject: Re: Conditional commit inside functions
Previous:From: Pavel StehuleDate: 2008-12-25 12:58:13
Subject: Re: Conditional commit inside functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group