SQL Newbie Question

From: Inoqulath <inoqulath(at)aol(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: SQL Newbie Question
Date: 2007-01-25 15:30:59
Message-ID: epaifs$2c92$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello Folks

Have a look at this Table:

CREATE TABLE foo(
id serial,
a_name text,
CONSTRAINT un_name UNIQUE (a_name));

Obviously, inserting a string twice results in an error (as one would
expect). But: is there any known possibility to ingnore an errorneous
INSERT like SQLite's "conflict algorithm" (SQLite:"INSERT OR
[IGNORE|ABORT] INTO foo [...]")?
I tried to use a trigger before INSERT takes place, but it seems that
before firing a trigger the constraints are checked...
Background: I'd like to INSERT a few thousand lines in one transaction,
where some values will be appear twice.

thx in Advance

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Isaac Ben 2007-01-25 15:34:08 column limit
Previous Message Csaba Nagy 2007-01-25 15:15:20 Re: too many trigger records found for relation "item" -