Re: Primary key constraint violation without error? - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: Primary key constraint violation without error?
Date
Msg-id 20060724130532.GA24454@winnie.fuhr.org
Whole thread Raw
In response to Primary key constraint violation without error?  (Mario Splivalo <mario.splivalo@mobart.hr>)
List pgsql-sql
On Mon, Jul 24, 2006 at 02:12:39PM +0200, Mario Splivalo wrote:
> Now I run the function again:
> 
> l_netsms=# select punimessages();
> NOTICE:  Ubacili smo za usera 4162.
> NOTICE:  Ubacili smo za usera 4161.
> NOTICE:  Ubacili smo za usera 4160.
> NOTICE:  Ubacili smo za usera 4159.
> NOTICE:  Ubacili smo za usera 4158.
>  punimessages
> --------------
>  t
> (1 row)
> 
> Shouldn't I get errors that I'm violating primary key constraint when
> INSERTing again same data?

No, because punimessages() has a truncate statement that empties
the table each time the function is called.  Should that truncate
statement be there?

-- 
Michael Fuhr


pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Primary key constraint violation without error?
Next
From: "Aaron Bono"
Date:
Subject: Re: System catalog table privileges