Skip site navigation (1) Skip section navigation (2)

int2 unique index malfunction (btree corrupt)

From: Christof Petig <christof(dot)petig(at)wtal(dot)de>
To: bugs(at)postgresql(dot)org
Subject: int2 unique index malfunction (btree corrupt)
Date: 1999-08-11 09:07:15
Message-ID: (view raw or whole thread)
Lists: pgsql-bugs
Dear PostgreSQL wizards,

During development of a CIM program I frequently updated a table by its
primary key (int2 or numeric(3)). A lot of strange messages
'NOTICE:  (transaction aborted): queries ignored until END' alerted me
that something is going wrong.

update foo set val=val+1 where key=:n
generated 'Cannot insert a duplicate key into a unique index'
which is definitely wrong.

Included is a very small (C++) program (Linux, egcs-1.1.1) which
generates the mentioned errors.

It occured with V6.5 as well as with August 2nd's CVS tree.

Sometimes even the initial 'insert's fail, one time I got an
'FATAL 1:  btree: items are out of order (leftmost 0, stack 10, update
1)' error.

It seems there is something wrong with PostgreSQL's internals. Perhaps
this program helps tracking it.

Best Regards,

PS: vacuum after the FATAL:
DEBUG:  --Relation test--
DEBUG:  Pages 13: Changed 2, Reapped 13, Empty 0, New 0; Tup 128: Vac
1823, Keep/VTL 0/0, Crash 0, UnUsed 0, MinLen 48, MaxLen 48; Re-using:
Free/Avail. Space 92444/86784; EndEmpty/Avail. Pages 0/12. Elapsed 0/0
DEBUG:  Index test_pkey: Pages 13; Tuples 128: Deleted 1819. Elapsed 0/0
DEBUG:  Rel test: Pages: 13 --> 1; Tuple(s) moved: 128. Elapsed 0/0 sec.

DEBUG:  Index test_pkey: Pages 13; Tuples 128: Deleted 128. Elapsed 0/0

Attachment: test.tgz
Description: application/octet-stream (948 bytes)

pgsql-bugs by date

Next:From: Sezai YilmazDate: 1999-08-11 22:20:40
Subject: table list problem.
Previous:From: Christof PetigDate: 1999-08-11 08:41:35
Subject: ecpg generates illegal code, patch included

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group