Re: Override defaults in inherited fields and tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Uwe Feldtmann <uwe(at)microshare(dot)com(dot)au>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Override defaults in inherited fields and tables
Date: 2002-08-31 03:34:43
Message-ID: 13068.1030764883@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Uwe Feldtmann <uwe(at)microshare(dot)com(dot)au> writes:
> Is it possible to override the defaults in inherited fields when
> defining tables?

Sure. This has worked for a release or two, IIRC:

regression=# create table parent (f1 int default 42);
CREATE TABLE
regression=# create table child (f1 int default 43) inherits (parent);
NOTICE: CREATE TABLE: merging attribute "f1" with inherited definition
CREATE TABLE
regression=# insert into child default values;
INSERT 153946 1
regression=# select * from child;
f1
----
43
(1 row)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Garo Hussenjian 2002-08-31 06:00:18 Bigint in sequences
Previous Message Uwe Feldtmann 2002-08-31 02:50:10 Override defaults in inherited fields and tables