From: | pgsql-bugs(at)postgresql(dot)org |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Unable to create an inheritad table with primary key containing inherited attribute |
Date: | 2000-10-30 15:56:31 |
Message-ID: | 200010301556.e9UFuV265552@hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Pascal Bourgeois (pbourgeois(at)atos(dot)be) reports a bug with a severity of 3
The lower the number the more severe it is.
Short Description
Unable to create an inheritad table with primary key containing inherited attribute
Long Description
If u create a table basetable having two attributes
mkey and mvalue then create a inherited table subtable (adding mykey2 and mvalue2 attributes) with primary key containing attributes mkey and mkey2, postgres returns an error indicating that attribute mkey is not known.
The only way to do is to create a unique index after table creation.
Sample Code
create table basetable (mykey varchar, myvalue int4, primary key (mykey));
create table subtable (mykey2 varchar, myvalue2, int4, primary key (mykey, mykey2)) inherits (basetable);
postgres will return that mykey attribute does not exists
end you have to do
create unique index subtable_pkey on subtable(mykey,mykey2);
No file was uploaded with this report
From | Date | Subject | |
---|---|---|---|
Next Message | Vadim Govorov | 2000-10-30 16:14:23 | unsubscribe |
Previous Message | Sean Kelly | 2000-10-30 10:41:16 | Re: Updating multiple bool values crashes backend |