Search Postgresql Archives

Re: SQL Newbie Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

On 01/25/07 09:54, btober@xxxxxxxxxxxxxxxx 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-----


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux