Re: Erroneous behavior of primary key

Поиск
Список
Период
Сортировка
От Rob Sargent
Тема Re: Erroneous behavior of primary key
Дата
Msg-id 1B74B41D-936B-464D-9D53-A7374C27F3A2@gmail.com
обсуждение исходный текст
Ответ на Erroneous behavior of primary key  (Daniel J Peacock <bluedanunit@gmail.com>)
Список pgsql-general

> On Aug 27, 2018, at 1:50 PM, Daniel J Peacock <bluedanunit@gmail.com> wrote:
>
> Good afternoon, all.
> I've got an odd situation with a table that has a varchar(255) as the primary key that is getting key values from an
Elasticsearchengine.  What I'm finding is that even though there is a primary key on the table, I am getting duplicated
keysin the data and the constraint is not blocking these.  When I do a "select <pk_field>,count(*) from <table> group
by<pk_field> having count(*) > 1" I get no results.  Yet, when I search the table for a value that is like a key I know
tobe duplicated, I get multiple results.  When I select from the table where field is equal to the duplicated field I
getone result.  I verified that they are distinct row with ctid.  I also created a clone of the table with CTAS and
thentried to create a unique index on the id varchar field but that failed with "duplicate keys found".  I'm stumped as
towhat could be the problem. 
> The only thing that I can think of is that the primary key is somehow corrupt.  I've noticed this behavior on other
tableson this database.   
> What could be causing this sort of problem?
>
> Thanks in advance for any insights.
>
> Dan Peacock
> Auto-wares, Inc.
Check for trailing white space

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

Предыдущее
От: Daniel J Peacock
Дата:
Сообщение: Erroneous behavior of primary key
Следующее
От: Ken Tanzer
Дата:
Сообщение: Re: Will there ever be support for Row Level Security on Materialized Views?