Re: PL/pgSQL Problem

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Ron St-Pierre <ron(dot)pgsql(at)shaw(dot)ca>
Cc: general <pgsql-general(at)postgresql(dot)org>
Subject: Re: PL/pgSQL Problem
Date: 2006-08-09 17:56:37
Message-ID: 20060809175637.GA71475@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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().

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2006-08-09 18:04:18 LinuxWorld West
Previous Message Ron St-Pierre 2006-08-09 17:33:02 PL/pgSQL Problem