In article <24680.1245784...@sss.pgh.pa.us>,
Tom Lane writes:
> Joshua Tolley writes:
>> Primary keys are NOT NULL and UNIQUE. You can't have null values in a primary
>> key.
> On reflection I think the OP's beef is that we complain about this:
> regression=# create table t (f1 int null not nu
Joshua Tolley writes:
> Primary keys are NOT NULL and UNIQUE. You can't have null values in a primary
> key.
On reflection I think the OP's beef is that we complain about this:
regression=# create table t (f1 int null not null);
ERROR: conflicting NULL/NOT NULL declarations for column "f1" of t
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
> test=# INSERT INTO
error informing that
primary key constraint is being violated. But IMHO the first INSERT is legal
SQL
Best,
Oliveiros
- Original Message -
From: "Harald Fuchs"
To:
Sent: Tuesday, June 23, 2009 4:14 PM
Subject: [SQL] Composite primary keys
I tried to throw some invalid S
Harald Fuchs writes:
> I tried to throw some invalid SQL to PostgreSQL and found its reaction
> confusing:
> test(# language char(3) NULL,
This is documented as being a no-op specification.
regards, tom lane
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.
I tried to throw some invalid SQL to PostgreSQL and found its reaction
confusing:
$ psql test
psql (8.4beta2)
Type "help" for help.
test=# CREATE TABLE t1 (
test(# id serial NOT NULL,
test(# name text NOT NULL,
test(# PRIMARY KEY (id)
test(# );
CREATE TABLE
te