Обсуждение: DROP INDEX causes errors
# 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
Вложения
On Mittwoch 17 Dezember 2008 Michael Monnerie wrote: > for each and every delete of a row in that table. After a > REINDEX TABLE dbmail_messageblks; > everything seems to work. I was wrong, still get this error: Dec 18 10:55:33 db2.zmi.at postgres[2816]: [112-1] DELETE:ERROR: could not open relation with OID 102021 Dec 18 10:55:33 db2.zmi.at postgres[2816]: [112-2] DELETE:CONTEXT: SQL statement "DELETE FROM ONLY "public"."dbmail_messageblks" how can I get rid of it? A vacuum and reindex table was already done, still... 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
Вложения
Michael Monnerie wrote: > On Mittwoch 17 Dezember 2008 Michael Monnerie wrote: > > for each and every delete of a row in that table. After a > > REINDEX TABLE dbmail_messageblks; > > everything seems to work. > > I was wrong, still get this error: > Dec 18 10:55:33 db2.zmi.at postgres[2816]: [112-1] DELETE:ERROR: could > not open relation with OID 102021 > Dec 18 10:55:33 db2.zmi.at postgres[2816]: [112-2] DELETE:CONTEXT: SQL > statement "DELETE FROM ONLY "public"."dbmail_messageblks" Does it persist if you close the connection and open a new one? -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support
On Donnerstag 18 Dezember 2008 Alvaro Herrera wrote: > Does it persist if you close the connection and open a new one? You're great, that worked indeed. I was a bit nervous now ;-) Thanks! 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