Re: PL/pgSQL Problem - Mailing list pgsql-general

From Ron St-Pierre
Subject Re: PL/pgSQL Problem
Date
Msg-id 44DA46A1.5060805@shaw.ca
Whole thread Raw
In response to Re: PL/pgSQL Problem  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
Michael Fuhr wrote:
> On Wed, Aug 09, 2006 at 10:33:02AM -0700, Ron St-Pierre wrote:
>
>> ERROR:  duplicate key violates unique constraint "systemcounts_pkey"
>> CONTEXT:  SQL statement "INSERT INTO dm.systemCounts (updateDate) VALUES (
>> $1 ::date)"
>> PL/pgSQL function "updatesystemcounts" line 8 at SQL statement
>>
>
> Is the table's primary key a serial column?  If so then the sequence
> might be out of sync with the values in the table, in which case
> you'll need to adjust the sequence's value with ALTER SEQUENCE or
> setval().
>
>
Aha, that was exactly what the problem was.

Thanks!

Ron

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: WIN32 Build?
Next
From: "Scott Marlowe"
Date:
Subject: Re: Tuning to speed select