On Tue, Jun 23, 2009 at 05:14:36PM +0200, Harald Fuchs wrote:
> test=# CREATE TABLE t2 (
> test(# id int NOT NULL REFERENCES t1,
> test(# language char(3) NULL,
> test(# txt text NOT NULL,
> test(# PRIMARY KEY (id, language)
> test(# );
> CREATE TABLE
<snip>
> test=# INSERT INTO t2 (id, language, txt) VALUES (2, NULL, 'text 1 no language');
> ERROR: null value in column "language" violates not-null constraint
Primary keys are NOT NULL and UNIQUE. You can't have null values in a primary
key.
- Josh / eggyknap