Re: 8.0 -> 8.1 dump duplicate key problem?

From: "Merlin Moncure" <merlin(dot)moncure(at)rcsonline(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 8.0 -> 8.1 dump duplicate key problem?
Date: 2005-11-14 15:31:29
Message-ID: 6EE64EF3AB31D5448D0007DD34EEB3417DD883@Herge.rcsinc.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> That's pretty bizarre. What's the datatype of the key column(s)?
>
> Can you reduce it to a smaller test case, or perhaps send me the full
> dump off-list? (270m is a bit much for email, but web or ftp would
> work ... also, presumably only the pkey column is needed to generate
> the error ...)

I just confirmed that there are duplicate p-keys in the source table :(.
Three currently but last week there were six. Just FYI I am not 100%
sure pg rebuilt the p-key with dups in it...I need to double check this.

esp=# select * from
esp-# (
esp(# select prl_combined_key, prl_seq_no, count(*) as c from
parts_order_line_file group by 1,2

esp(# ) q where q.c > 1;
prl_combined_key | prl_seq_no | c
------------------+------------+---
00136860 | 20 | 2
00136860 | 23 | 2
00137050 | 1 | 2
(3 rows)

esp=# \d parts_order_line_file
Table "data1.parts_order_line_file"
Column | Type | Modifiers
--------------------------+-------------------------+-----------
[...]
Indexes:
"parts_order_line_file_pkey" PRIMARY KEY, btree (prl_combined_key,
prl_seq_no)
"parts_order_line_file_prl_exchange_part_key" UNIQUE, btree
(prl_exchange_part, id)
"parts_order_line_file_prl_item_no_key" UNIQUE, btree (prl_item_no,
id)
"parts_order_line_file_prl_trx_type_2_key" UNIQUE, btree
(prl_combined_key_2, prl_item_no, id)

I keep a timestamp on every row for last modified date:

esp=# select lastmod from parts_order_line_file where prl_combined_key =
' 00136860' and prl_seq_no
in (20, 23);
lastmod
-------------------------
2005-09-15 11:17:17.062
2005-09-15 11:17:17.187
(2 rows)

There have been no schema changes since 9/15...

Merlin

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2005-11-14 15:32:30 Re: Should a plan node's result tuple slot be read-only to caller?
Previous Message Gavin Sherry 2005-11-14 15:27:21 Re: PostgreSQL roadmap for 8.2 and beyond