Re: Multiple Primary Keys

From: "samsom, debra" <dsamsom(at)bristol(dot)ca>
To: 'Josh Berkus' <josh(at)agliodbs(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Multiple Primary Keys
Date: 2002-04-18 18:22:48
Message-ID: 7b06036f040cdd07d2@[10.1.1.200]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

You wouldn't believe how long I stared at this and not seen my mistake.
Sometimes it just takes another pair of eyes. Of course it works now...

Many thanks :)

-----Original Message-----
From: Josh Berkus [mailto:josh(at)agliodbs(dot)com]
Sent: Thursday, April 18, 2002 12:47 PM
To: samsom, debra; 'Josh Berkus'; pgsql-novice(at)postgresql(dot)org
Subject: Re: [NOVICE] Multiple Primary Keys

Debra,

> psql dc postgres -c "create table "attachments"(
> "docn" varchar(25) NOT NULL,
> "issue" varchar(6) NOT NULL,
> "docna" varchar(4) NOT NULL,
> "issuea" varchar(20) NOT NULL,
> "applic" varchar(3),
> "whereused" varchar(1),
> CONSTRAINT "attachments_pkey"
> PRIMARY KEY ("docn","issue","docna","issuea"));"
>
> docn issue docna
> issuea
>
> 012T2100 SHT 01 K001 DR 911380
> A001
> 012T2100 SHT 01 L001 012T2100 SHT 01 ADCN 267
> -001
> 012T2100 SHT 01 L001 012T2100 SHT 01 ADCN 268
> -001
> 012T2100 SHT 01 L001 012T2100 SHT 01 ADCN 270
> -001
> 012T2100 SHT 01 L001 012T2100 SHT 01 ADCN 271
> -001
> 012T2100 SHT 01 L001 012T2100 SHT 01 ADCN 272
> -001

Here's the reason: Your table definition and your data do not match.
In your tabledef, docna has 4 characters and issuea has 20. However,
in your data, docna has 20 characters and issuea has 4. Fix this, and
you should be able to load your data.

-Josh Berkus

Browse pgsql-novice by date

  From Date Subject
Next Message Mark Thomas 2002-04-18 19:48:15 libpq - sample code?
Previous Message Josh Berkus 2002-04-18 17:47:07 Re: Multiple Primary Keys