Re: Inserting possible dublicate unique keys

From: Alvar Freude <alvar(at)agi(dot)de>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inserting possible dublicate unique keys
Date: 2001-03-29 16:35:37
Message-ID: 3AC36459.E6EA5972@huitzilopochtli
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martín Marqués 2001-03-29 16:37:37 database dirs very stange on solaris
Previous Message Brent R. Matzelle 2001-03-29 16:30:01 Re: full table scan on 'select max(value) from table'?