Skip site navigation (1) Skip section navigation (2)

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 17:36:03
Message-ID: 7adb3e54040c7707d2@[10.1.1.200] (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-novice
> Yes, it could be.  Certain characters, such as \ and <tab> can cause
> COPY to misbehave.  Can you post your full tabledef, plus a few lines
> of the COPY file?

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

The duplicate error is on the third line of data ..
The headings are for your reference only, they aren't really in the file.
It's also a tab delimited file.


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


Debra,

> It will be tough redesigning the database to use a surrogate key,
> cause it
> links to other tables using this key and I can't lose this
> relationship.

OK.  Just keep it in mind for the next database ;-)

> I ran the select query (looking for duplicate data) and the result
> returned
> 0 rows.  I have also run this copy using just a few records that I
> know are
> unique with the same result.
>
> Unfortunately these fields do contain spaces and funny characters,
> could
> this be the problem??

Yes, it could be.  Certain characters, such as \ and <tab> can cause
COPY to misbehave.  Can you post your full tabledef, plus a few lines
of the COPY file?

-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________
                                       Josh Berkus
  Complete information technology      josh(at)agliodbs(dot)com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

pgsql-novice by date

Next:From: Josh BerkusDate: 2002-04-18 17:47:07
Subject: Re: Multiple Primary Keys
Previous:From: Tom LaneDate: 2002-04-18 17:03:58
Subject: Re: Aggregate Network Address functions?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group