| От | Tom Lane |
|---|---|
| Тема | Re: duplicates on primary key column |
| Дата | |
| Msg-id | 3524.1072194228@sss.pgh.pa.us обсуждение |
| Ответ на | Re: duplicates on primary key column (Marcin Gil <marcin.gil@audax.com.pl>) |
| Ответы |
Re: duplicates on primary key column
|
| Список | pgsql-novice |
Marcin Gil <marcin.gil@audax.com.pl> writes:
> Tom Lane wrote:
>> I see no duplicate keys in your dump. How do you provoke the problem
>> exactly?
> Hmm.. It's enough to do 'select docid from documents where docid=0'
> and I get 3 answers (3 rows).
That's because you made "archives" inherit from "documents", so the scan
includes the rows in "archives" that have docid=0.
You could do "SELECT docid FROM ONLY documents" if you don't want the
scan to include child tables. But it's probably a bad idea to use
inheritance for the archives table at all.
regards, tom lane
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера