multicolumn PRIMARY KEY introduces wrong 'not null' fields

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: multicolumn PRIMARY KEY introduces wrong 'not null' fields
Date: 2001-08-21 01:44:20
Message-ID: 200108210144.f7L1iKC91768@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Laurent Martelli (laurent(at)bearteam(dot)org) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
multicolumn PRIMARY KEY introduces wrong 'not null' fields

Long Description
If you have a primary key on several columns, each of these columns is given the 'not null' modifier. I can't see why this is required. In the example below, the 'Type' column is made 'not null'.

Sample Code
CREATE TABLE test (
Type integer,
PictureID integer NOT NULL REFERENCES pictures(PictureID),
Value character varying(128) NOT NULL,
PRIMARY KEY (Type,PictureID,Value));

No file was uploaded with this report

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2001-08-21 02:11:58 Re: multicolumn PRIMARY KEY introduces wrong 'not null' fields
Previous Message Andreas Wernitznig 2001-08-20 20:10:40 Re: low performance