"temporary" table is still there

Started by Chris Jonesover 25 years ago2 messagesgeneral
Jump to latest
#1Chris Jones
chris@mt.sri.com

Last Friday, I started a psql script that created a temporary table,
shuffled lots of data through it, and dropped it. Unfortunately, the
machine crashed before the script finished.

Now I have a table called pg_temp.1548.0, and I can't delete it:

fastfacts=> drop table "pg_temp.1548.0";
ERROR: class "pg_temp.1548.0" is a system catalog

The same thing happens, whether I'm connected as a mortal user or as
the PG super-user.

What now?

Chris

--
----------------------------------------------------- chris@mt.sri.com
Chris Jones SRI International, Inc.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Chris Jones (#1)
Re: "temporary" table is still there

Chris Jones <chris@mt.sri.com> writes:

Now I have a table called pg_temp.1548.0, and I can't delete it:
fastfacts=> drop table "pg_temp.1548.0";
ERROR: class "pg_temp.1548.0" is a system catalog
The same thing happens, whether I'm connected as a mortal user or as
the PG super-user.

I think you need to restart the postmaster with "-o -O"
(allowSystemTableMods) to be allowed to drop that table.

Perhaps temp tables shouldn't be protected quite as fiercely as the
system catalogs are ;-)

regards, tom lane