Re: Filtering duplicated row with a trigger

From: Nabil Sayegh <postgresql(at)e-trolley(dot)de>
To: papapep <papapep(at)gmx(dot)net>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Filtering duplicated row with a trigger
Date: 2003-10-06 16:43:31
Message-ID: 3F819BB3.9060209@e-trolley.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

papapep wrote:
> Anyone can give me some guide to how the function should do the control
> of duplicated rows?

First tell us what the function should do.
If you just want to ignore the 'duplicate' rows, that's easy:

define 1 column as unique and just insert (without transaction) the data
row by row.
Every 'duplicate' row will throw an error, but since we don't use a
transaction here the row is 'ignored', leaving only rows that are
distinct for that unique column.

I write 'duplicate' in quotes, because you didn't define what you mean
by duplicate.

HTH
--
e-Trolley Sayegh & John, Nabil Sayegh
Tel.: 0700 etrolley /// 0700 38765539
Fax.: +49 69 8299381-8
PGP : http://www.e-trolley.de

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2003-10-06 16:48:06 Re: Filtering duplicated row with a trigger
Previous Message papapep 2003-10-06 16:30:29 Filtering duplicated row with a trigger