Skip site navigation (1) Skip section navigation (2)

Re: Bulkloading using COPY - ignore duplicates?

From: "Mikheev, Vadim" <vmikheev(at)SECTORBASE(dot)COM>
To: "'Daniel Kalchev'" <daniel(at)digsys(dot)bg>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bulkloading using COPY - ignore duplicates?
Date: 2002-01-04 20:14:43
Message-ID: 3705826352029646A3E91C53F7189E3251846D@sectorbase2.sectorbase.com (view raw or flat)
Thread:
Lists: pgsql-hackers
>  > 1. I prefer Oracle' (and others, I believe) way - put
> statement(s) in PL block and define for what exceptions
> (errors) what actions should be taken (ie IGNORE for
>  > NON_UNIQ_KEY error, etc).
> 
> Some people prefer 'pure' SQL. Anyway, it can be argued which
> is worse - the usage of non-SQL language, or usage of extended
> SQL language. I guess the SQL standard does not provide for such
> functionality?

Yes, there is no such syntax in standard. And imho when some
feature is not in standard then it's better to implement it
how others do (for as much compatibility as possible/significant).

>  > 2. For INSERT ... SELECT statement one can put DISTINCT in
> select' target list.
> 
> With this construct, you are effectively copying rows from
> one table to another - or constructing rows from various
> sources (constants, other tables etc) and inserting these
> in the table. If the target table has unique indexes 
> (or constraints), and some of the rows returned by SELECT violate

Sorry, I didn't consider this case, you're right.

> I believe all this functionality will have to consider the 
> syntax firts.

All this functionality will have to consider savepoints
implementation first. As for syntax - we could implement both.

Vadim

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2002-01-04 21:08:18
Subject: O_DIRECT use
Previous:From: Mikheev, VadimDate: 2002-01-04 19:48:26
Subject: Re: ON ERROR triggers

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group