Re: Primary key constraint violation without error?

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Primary key constraint violation without error?
Дата
Msg-id 20060724130532.GA24454@winnie.fuhr.org
обсуждение исходный текст
Ответ на Primary key constraint violation without error?  (Mario Splivalo <mario.splivalo@mobart.hr>)
Список 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 по дате отправления:

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Primary key constraint violation without error?
Следующее
От: "Aaron Bono"
Дата:
Сообщение: Re: System catalog table privileges