Re: Inserting possible dublicate unique keys - Mailing list pgsql-general

From Alvar Freude
Subject Re: Inserting possible dublicate unique keys
Date
Msg-id 3AC36459.E6EA5972@huitzilopochtli
Whole thread Raw
In response to Inserting possible dublicate unique keys  (Alvar Freude <alvar.freude@huitzilopochtli.agi.de>)
List pgsql-general
Hi,

Richard Huxton wrote:
>
> > CREATE TABLE referer (
> >    id SERIAL,
> >    referer varchar(2048) NOT NULL PRIMARY KEY
> >    );
[...]
>
> Why have you got id as a serial if referer is your primary key? Oh - I
> suppose it's easier to reference a serial of course, less data to carry
> around.

oh, in reality the id is an int4 with unique index and nectval(...) ;-)


> The only thing I can think of is to insert into a staging table where
> referer isn't unique and insert into the real table from a snapshot of that
> staging table. Not sure that's a cleaner solution than yours though.

hm, but for this I have to change IDs in the Referencing Log-Table later
....


Now it works since two days on the production server with the solution
"try once again if error" and it seems it works good :-)


Ciao
  Alvar


--
AGI
Magirusstrasse 21B, 70469 Stuttgart
Fon +49 (0)711.228 74-50, Fax +49 (0)711.228 74-88
+++news+++news+++news+++
Beste Image-Website 2001 kommt von AGI
http://www.agi.de/tagebuch
http://www.agi.com/diary (english)

pgsql-general by date:

Previous
From: "Brent R. Matzelle"
Date:
Subject: Re: full table scan on 'select max(value) from table'?
Next
From: "Richard Huxton"
Date:
Subject: Re: tables, where