view table pkey values

Поиск
Список
Период
Сортировка
От Scott Frankel
Тема view table pkey values
Дата
Msg-id 714B692C-6F0B-4EE6-8809-6818ABF1ED38@pacbell.net
обсуждение исходный текст
Ответы Re: view table pkey values
Re: view table pkey values
Список pgsql-general
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





В списке pgsql-general по дате отправления:

Предыдущее
От: Denis BUCHER
Дата:
Сообщение: Re: Strange "missing tables" problem
Следующее
От: Raymond O'Donnell
Дата:
Сообщение: Re: view table pkey values