Re: skip duplicate key error during inserts

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: skip duplicate key error during inserts
Date: 2006-10-27 11:05:32
Message-ID: 4541E7FC.5050909@cox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/27/06 05:10, Gurjeet Singh wrote:
> On 10/27/06, Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net> wrote:
>
> That doesn't help at all during multi-table transactions
>
>
> What problem do you think you would face in multi-table scenario? I tried
> the following and it worked for me; hope this is what you meant by
> multi-table transactions:
>
> postgres=# begin;
> BEGIN
> postgres=# create table t1 ( a int primary key );
[snip]
> postgres=# commit;
> COMMIT
> postgres=# select * from t1;
> a
> ---
> 1
> (1 row)
>
> postgres=# select * from t2;
> a
> ---
> 1
> (1 row)
>
> postgres=#

Dueling examples. Attached are two examples of errors.

BTW, PG 8.1.5.

> want the loader to kick duplicates out to an
>> exception file.
>>
>
> Now you are asking for a completely new feature!!!

But easily doable if errors don't puke a transaction.

--
Ron Johnson, Jr.
Jefferson LA USA

Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.

Attachment Content-Type Size
txn_error.txt text/plain 581 bytes
txn_error2.txt text/plain 441 bytes

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gerson Machado 2006-10-27 11:11:01 Send email from PostgreSQL, may I ?
Previous Message Gurjeet Singh 2006-10-27 10:10:47 Re: skip duplicate key error during inserts