Vanishing unique constraint

Поиск
Список
Период
Сортировка
От Bernhard Beroun
Тема Vanishing unique constraint
Дата
Msg-id 5301-5ed4b600-3-d1dc0d0@127402255
обсуждение исходный текст
Ответы Re: Vanishing unique constraint  (Julien Rouhaud <rjuju123@gmail.com>)
Список pgsql-general
Hello,

I am experiencing a strange thing on my production database server, which I can't explain.

On my production database server, there is a table called "label_suggestion" which has a unique constraint on the "name" column. If I do a "\d+ label_suggestion" I can see, that the unique constraint shows up with

"label_suggestion_name_unique" UNIQUE CONSTRAINT, btree (name)

in the output. But when I execute the following query

SELECT name FROM label_suggestion GROUP BY name HAVING COUNT(name) > 1

I can see that there are actually entries with a duplicate name in the database, which makes me believe that the unique constraint isn't there at all. (or at least it's not enforced)

Next, I dumped the complete production database (via pg_dumpall) and applied the dump on my local machine. I did again a "\d+ label_suggestion" and now the unique constraint doesn't show up anymore.

Anyone an idea what's going on here?

(Both the production database server and my local database server are running at version 9.6.18)

Any help is really appreciated.

Thanks,
Bernhard

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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: Oracle vs. PostgreSQL - a comment
Следующее
От: Gabriele Bulfon
Дата:
Сообщение: Re: problem with self built postgres 9.0.9