Re: SQL Newbie Question

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: SQL Newbie Question
Date: 2007-01-25 16:02:30
Message-ID: 45B8D496.7030008@cox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/25/07 09:54, btober(at)ct(dot)metrocast(dot)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-----

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Filip Rembiałkowski 2007-01-25 16:02:35 Re: Problem with result ordering
Previous Message Ron Johnson 2007-01-25 15:55:18 Re: Problem with result ordering