Re: sequence last_value

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: "Duncan Adams (DNS)" <duncan(dot)adams(at)vcontractor(dot)co(dot)za>, "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: sequence last_value
Date: 2001-10-12 18:50:06
Message-ID: web-146834@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Duncan,

>
> wireman=# insert into loc values (1,1,'HELP');
> ERROR: Cannot insert a duplicate key into unique index loc_pkey

Try this instead:

INSERT INTO loc ( building_key, floor, ref )
VALUES (1, 1, 'Help');

Explicit column naming in INSERTs is always a good idea.

Also, upgrading to 7.1.3 would be a good idea, although unrelated to
your problem.

Finally, SERIAL and NEXTVAL sequences do not work properly in older
versions of pgODBC, if you're using a WIndows client. Upgrading to the
new pgAdmin will solve this.

-Josh Berkus

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message John Burski 2001-10-12 19:13:29 Re: sequence last_value
Previous Message Smith, David (DMSMITH) 2001-10-12 12:08:28 cygncurses5.dll