Re: SQL Newbie Question - Mailing list pgsql-general

From Ron Johnson
Subject Re: SQL Newbie Question
Date
Msg-id 45B8D00C.9040804@cox.net
Whole thread Raw
In response to SQL Newbie Question  (Inoqulath <inoqulath@aol.de>)
Responses Re: SQL Newbie Question
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/25/07 09:30, Inoqulath wrote:
> 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.

No.

  Unique \U*nique"\, a. [F. unique; cf. It. unico; from L. unicus,
     from unus one. See {One}.]
     Being without a like or equal; unmatched; unequaled;
     unparalleled; single in kind or excellence; sole. --
     {U*nique"ly}, adv. -- {U*nique"ness}, n.
     [1913 Webster]


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFuNAMS9HxQb37XmcRAh4XAJ99ebAGyuHTFc9+bLiuW5ewPJkIYgCgguLP
1UDAUlXSGnZrKQb4Czoqp5w=
=Wm9P
-----END PGP SIGNATURE-----

pgsql-general by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Subject: Postgres processes have a burst of CPU usage
Next
From: Thorsten Körner
Date:
Subject: Problem with result ordering