Re: [GENERAL] duplicate primary key entries?

2003-11-26 Thread Tom Lane
Baldur Norddahl [EMAIL PROTECTED] writes:
 It really sucks that inheritance breaks their parent tables constraints :-(.

Yeah, we know :-(.  Sooner or later someone will work out a solution
to that.

Thanks for following up to close out this open issue.

regards, tom lane

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


[GENERAL] duplicate primary key entries?

2003-11-25 Thread Baldur Norddahl
Hi,

I just noticed something bad in our database:

webshop=# select oid,* from content_loc where id=20488;
   oid   |  id   | locale | name
-+---++--
 9781056 | 20488 | any| Rise Part II
 9781058 | 20488 | any| Rise Part II
(2 rows)

webshop=# \d content_loc
  Table public.content_loc
 Column |  Type   | Modifiers
+-+---
 id | integer | not null
 locale | text| not null
 name   | text|
Indexes: content_loc_pkey primary key btree (id, locale)
Foreign Key constraints: $1 FOREIGN KEY (id) REFERENCES content(id) ON UPDATE
CASCADE ON DELETE CASCADE,
 $2 FOREIGN KEY (locale) REFERENCES languages(locale) ON
UPDATE CASCADE ON DELETE CASCADE



Apparently there are two rows with identical primary keys which should not be
possible. Is this a know problem? Can I expect everything to be ok if I just
delete the extra entry?

I am using the debian packages of postgresql 7.3.4-9.

Thanks,

Baldur


This message was sent using IMP, the Internet Messaging Program.

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [GENERAL] duplicate primary key entries?

2003-11-25 Thread Martijn van Oosterhout
On Tue, Nov 25, 2003 at 12:22:29PM +0100, Baldur Norddahl wrote:
 Hi,
 
 I just noticed something bad in our database:
 
 webshop=# select oid,* from content_loc where id=20488;
oid   |  id   | locale | name
 -+---++--
  9781056 | 20488 | any| Rise Part II
  9781058 | 20488 | any| Rise Part II
 (2 rows)

Any possibility there are hidden spaces? What is the output of:

select oid,id,'['||locale||']','['||name||']' from content_loc where id=20488;

Hope this helps,
-- 
Martijn van Oosterhout   [EMAIL PROTECTED]   http://svana.org/kleptog/
 All that is needed for the forces of evil to triumph is for enough good
 men to do nothing. - Edmond Burke
 The penalty good people pay for not being interested in politics is to be
 governed by people worse than themselves. - Plato


pgp0.pgp
Description: PGP signature