DROP INDEX causes errors

From: Michael Monnerie <michael(dot)monnerie(at)is(dot)it-management(dot)at>
To: pgsql-admin(at)postgresql(dot)org
Subject: DROP INDEX causes errors
Date: 2008-12-17 22:09:54
Message-ID: 200812172309.54457@zmi.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

# select version();
version
-------------------------------------------------------------------------------------------------------------------
PostgreSQL 8.1.11 on x86_64-unknown-linux-gnu, compiled by GCC gcc
(GCC) 4.1.2 20061115 (prerelease) (SUSE Linux)

Today I dropped an index:
DROP INDEX dbmail_messageblks_physmessage_idx ;

The table is now:
# \d dbmail_messageblks
Tabelle »public.dbmail_messageblks«
Spalte | Typ | Attribute
-----------------+----------+------------------------------------------------------------------
messageblk_idnr | bigint | not null default
nextval('dbmail_messageblk_idnr_seq'::regclass)
physmessage_id | bigint |
messageblk | bytea | not null
blocksize | bigint | not null default (0)::bigint
is_header | smallint | not null default (0)::smallint
Indexe:
»dbmail_messageblks_pkey« PRIMARY KEY, btree (messageblk_idnr)
»dbmail_messageblks_physmessage_is_header_idx« btree
(physmessage_id, is_header) CLUSTER
Fremdschlüssel-Constraints:
»dbmail_messageblks_physmessage_id_fkey« FOREIGN KEY
(physmessage_id) REFERENCES dbmail_physmessage(id) ON UPDATE CASCADE ON
DELETE CASCADE

And immediately after the drop I got this:
DELETE:ERROR: could not open relation with OID 102021
DELETE:CONTEXT: SQL statement "DELETE FROM ONLY
"public"."dbmail_messageblks" WHERE "physmessage_id" = $1"

for each and every delete of a row in that table. After a
REINDEX TABLE dbmail_messageblks;
everything seems to work.

Is that a bug or did I do something bad?

mfg zmi
--
// Michael Monnerie, Ing.BSc ----- http://it-management.at
// Tel: 0660 / 415 65 31 .network.your.ideas.
// PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4
// Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Naomi Walker 2008-12-18 01:50:44 pg_xlog
Previous Message Alvaro Herrera 2008-12-17 19:46:38 Re: controlling autovacuum during the day.