From: Michael Fuhr <mike@fuhr.org>
To: Mario Splivalo <mario.splivalo@mobart.hr>
Cc: pgsql-sql@postgresql.org
Subject: Re: Primary key constraint violation without error?
Date: Mon, 24 Jul 2006 07:05:32 -0600
Message-ID: <20060724130532.GA24454@winnie.fuhr.org> (raw)
In-Reply-To: <1153743159.28381.15.camel@localhost.localdomain>
References: <1153743159.28381.15.camel@localhost.localdomain>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: mike@fuhr.org, mario.splivalo@mobart.hr
Subject: Re: Primary key constraint violation without error?
In-Reply-To: <20060724130532.GA24454@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox