Re: [HACKERS] default values in inheritance hierarchies

2012-02-27 Thread Tom Lane
=?ISO-8859-2?Q?Miroslav_=A9imul=E8=EDk?= writes: > Is there any way how to force UPDATE to use default value of ID column from > table a2 when updating rows in this table, without using triggers? No. The update is expanded using the default expression applicable to the table that is named in the

Re: [HACKERS] default values in inheritance hierarchies

2012-02-27 Thread Miroslav Šimulčík
Sorry, I have accidentaly sent incomplet mail. Here is the rest: The following sequence of commands will end up with error, because of duplicate ID in table a2: insert into a2(data2, data) values(456, 'jkl'); insert into a2(data2, data) values(789, 'mno'); Is there any way how to force

[HACKERS] default values in inheritance hierarchies

2012-02-27 Thread Miroslav Šimulčík
Hi, I have two tables defined for example like this: create table a1 (id serial primary key, data text); create table a2 (id serial primary key, data2 integer) inherits (a1); The point is, that I want to have two tables with inheritance relation between them, but each with its own id col