Re: SQL Newbie Question - Mailing list pgsql-general

From Ron Johnson
Subject Re: SQL Newbie Question
Date
Msg-id 45B8D496.7030008@cox.net
Whole thread Raw
In response to Re: SQL Newbie Question  (btober@ct.metrocast.net)
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/25/07 09:54, btober@ct.metrocast.net wrote:
> Ron Johnson wrote:
>> On 01/25/07 09:30, Inoqulath wrote:
[snip]
> I think he is not asking "How do I insert duplicate rows into a
> unique-constrained column?", but rather that he wants to have the insert
> transaction proceed successfully, ignoring the duplicates, i.e., the
> resulting inserted rows will number less than the original source rows
> by exactly the subset of duplicate source rows.

Ah, ok.

> My suggestion would be to load the data into an unconstrained temporary
> table, then select distinct from that for insertion into your actual
> working table.

That works on tables of a few thousand rows.  Even a few million
rows.  Doesn't scale, though.

Savepoints might be a workaround, also.

Still, pg *really* needs a "not rollback on error" mode.  Throw the
exception, let the app handle it and keep on going.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFuNSWS9HxQb37XmcRAvoUAJ4r7RIxj+JH9gcZNadQrQFaI/NTnwCeM6Al
ZdpFvGuV4AemAYTXbY+Vgaw=
=GxBV
-----END PGP SIGNATURE-----

pgsql-general by date:

Previous
From: Ron Johnson
Date:
Subject: Re: Problem with result ordering
Next
From: Inoqulath
Date:
Subject: Re: SQL Newbie Question