From: | Lynna Landstreet <lynna(at)gallery44(dot)org> |
---|---|
To: | <pgsql-novice(at)postgresql(dot)org> |
Subject: | One more keywords problem (hopefully the last) |
Date: | 2003-07-03 20:57:55 |
Message-ID: | BB2A1113.4E7%lynna@gallery44.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
OK, can you stand one more question from me about this whole keyword thing?
I've now got them all sorted onto separate lines in a text file the way I
want them, and while I initially ran into a few problems with duplicate
entries due to a few keywords being repeated in two categories, I've fixed
that. However, now I'm getting this:
ERROR: key_art_temp_fk_key referential integrity violation - key
referenced from key_art_temp not found in keywords
lost synchronization with server, resetting connection
Obviously there's some kind of problem with one or more of the keywords in
the temp file not being found in the keywords file, but as far as I know
there shouldn't be. All the keywords I can see in it look fine, and the
stupid error message doesn't even give me a line number so I don't know
where to look for the problem. Isn't there some kind of unwritten law that
all error messages must include line number? If not, there should be.
So... does anyone know how I could figure out what's causing this? The exact
command I used was:
\copy key_art_temp from key_art_join.txt using delimiters '|' with
null as ''
The script used to create the table was:
CREATE TABLE key_art_temp
(
artist_id SMALLINT NOT NULL,
keyword_id SMALLINT ,
keyword VARCHAR(40) NOT NULL,
CONSTRAINT key_art_temp_pk PRIMARY KEY (artist_id,keyword),
CONSTRAINT key_art_temp_fk_art FOREIGN KEY (artist_id)
REFERENCES artists(artist_id),
CONSTRAINT key_art_temp_fk_key FOREIGN KEY (keyword)
REFERENCES keywords(keyword)
);
And some sample lines from the text file I'm trying to import:
100||industry
100||nature
105||activist
105||aging/mortality
105||body
The empty column in the middle is because I ultimately want the key_art_join
able to reference the keyword ID numbers, not the keywords themselves, but
given how the data from FMP was formatted, it was easier to import the
keywords into a temporary table and then match them up with the ID numbers
in the real join table afterwards by looking up those from the keyword
table.
Any ideas? Is there some really simple reason this is screwing up that I'm
just somehow missing?
Lynna
--
Resource Centre Database Coordinator
Gallery 44
www.gallery44.org
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2003-07-03 21:23:21 | Re: One more keywords problem (hopefully the last) |
Previous Message | Josh Berkus | 2003-07-03 16:31:23 | Re: query question |