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