pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Monnerie <michael.monnerie@is.it-management.at>
To: pgsql-admin@postgresql.org
Subject: DROP INDEX causes errors
Date: Wed, 17 Dec 2008 23:09:54 +0100
Message-ID: <200812172309.54457@zmi.at> (raw)

# 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

Attachments:

  signature.asc (application/pgp-signature, 196B) download

view thread (4+ messages)  latest in thread

Message-ID: <200812172309.54457@zmi.at>
Permalink:  ../200812172309.54457@zmi.at/
Also on:    postgresql.org/message-id/200812172309.54457@zmi.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: michael.monnerie@is.it-management.at
  Subject: Re: DROP INDEX causes errors
  In-Reply-To: <200812172309.54457@zmi.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox