Re: [personal] Re: Filtering duplicated row with a trigger - Mailing list pgsql-novice

From papapep
Subject Re: [personal] Re: Filtering duplicated row with a trigger
Date
Msg-id 3F819EBC.1040101@gmx.net
Whole thread Raw
In response to Re: Filtering duplicated row with a trigger  (Bruno Wolff III <bruno@wolff.to>)
Responses Re: [personal] Re: Filtering duplicated row with a trigger  (Josh Berkus <josh@agliodbs.com>)
Re: [personal] Re: Filtering duplicated row with a trigger  (Nabil Sayegh <postgresql@e-trolley.de>)
Re: [personal] Re: Filtering duplicated row with a trigger  (Bruno Wolff III <bruno@wolff.to>)
Re: [personal] Re: Filtering duplicated row with a trigger  (Josh Berkus <josh@agliodbs.com>)
List pgsql-novice
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bruno Wolff III wrote:
| On Mon, Oct 06, 2003 at 18:30:29 +0200,
|   papapep <papapep@gmx.net> wrote:
|
|>-----BEGIN PGP SIGNED MESSAGE-----
|>Hash: SHA1
|>
|>I've got plenty of data files (prepared to be inserted with the \copy
|>statement) but I have to filter them to be sure that there are no
|>duplicated rows inserted.
|>I know I should do it with a trigger that executes a function before
|>inserting the row and if it's duplicated do something with it (insert it
|>in another table, simply forget it, etc...). The theory is clear :-)
|>But the practice is not so clear (for me, of course).
|>Anyone can give me some guide to how the function should do the control
|>of duplicated rows?
|
|
| You might want to consider reading the data into a temp table and then
using
| a query to do something with duplicates.

I'm very sorry, but I think I don't understand completely what you mean.
Perhaps you suggest to insert the whole data in an initial temporary
table and verify the duplicates in the temporary table before
transfering the "good" rows to the real table? If so, how should I do
the duplicates control in the temp table? (for me is as difficult as my
first question :-( )
Consider that the primary key that we use to see if the row is
duplicated, or not, is a 5 fields key (it has to be so, is a complex
data to filter).

Josep Sànchez
[papapep]



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/gZ672vx52x0kyz4RArRxAKDArnFviC+kHBb0IGAUPb8mgR2pZACgqjiW
zdODPtlhLLRo0qEnOcUxnPM=
=wt1I
-----END PGP SIGNATURE-----




pgsql-novice by date:

Previous
From: Nabil Sayegh
Date:
Subject: Re: Filtering duplicated row with a trigger
Next
From: Josh Berkus
Date:
Subject: Re: [personal] Re: Filtering duplicated row with a trigger