Re: Override defaults in inherited fields and tables - Mailing list pgsql-general

From Tom Lane
Subject Re: Override defaults in inherited fields and tables
Date
Msg-id 13068.1030764883@sss.pgh.pa.us
Whole thread Raw
In response to Override defaults in inherited fields and tables  (Uwe Feldtmann <uwe@microshare.com.au>)
List pgsql-general
Uwe Feldtmann <uwe@microshare.com.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

pgsql-general by date:

Previous
From: Uwe Feldtmann
Date:
Subject: Override defaults in inherited fields and tables
Next
From: Garo Hussenjian
Date:
Subject: Bigint in sequences