Re: SQL Newbie Question

Поиск
Список
Период
Сортировка
От Ron Johnson
Тема Re: SQL Newbie Question
Дата
Msg-id 45B8D496.7030008@cox.net
обсуждение исходный текст
Ответ на Re: SQL Newbie Question  (btober@ct.metrocast.net)
Список 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 по дате отправления:

Предыдущее
От: Ron Johnson
Дата:
Сообщение: Re: Problem with result ordering
Следующее
От: Inoqulath
Дата:
Сообщение: Re: SQL Newbie Question