Search Postgresql Archives

view table pkey values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hello,

Is it possible to select or otherwise view a table's primary key values?


I'm troubleshooting the following error:

	ERROR:  duplicate key value violates unique constraint "foo_pkey"

The insert that yields the error seems innocuous enough:

	INSERT INTO foo (color_id, ordinal, person_id) VALUES (1, 1019, 2);

It seems as if there's a sequence (foo_pkey) that's got some weird values in it. The table itself looks like this:


CREATE TABLE foo (
	foo_id	SERIAL		PRIMARY KEY,
color_id INTEGER NOT NULL REFERENCES color(color_id) ON DELETE NO ACTION,
	ordinal				INTEGER		DEFAULT NULL,
person_id INTEGER NOT NULL REFERENCES person(person_id) ON DELETE SET NULL ON UPDATE CASCADE,
	created				timestamp	DEFAULT CURRENT_TIMESTAMP);



Thanks in advance,
Scott





--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux