Re: ERROR: type "temp_gc" already exists - Mailing list pgsql-general

From Janning Vygen
Subject Re: ERROR: type "temp_gc" already exists
Date
Msg-id 200509151024.43282.vygen@gmx.de
Whole thread Raw
In response to Re: ERROR: type "temp_gc" already exists  (Janning Vygen <vygen@gmx.de>)
Responses Re: ERROR: type "temp_gc" already exists
List pgsql-general
> Janning Vygen <vygen ( at ) gmx ( dot ) de> writes:
> > Am Samstag, 10. September 2005 18:05 schrieb Tom Lane:
> >> If there's no pg_depend entry then DROP TYPE should work.  Otherwise
> >> you might have to resort to manually DELETEing the pg_type row.
>
> > Thanks for your detailed answer. I don't want to do anything wrong. To be
> > sure, i have some more questions:
>
> > - There is no entry in pg_depend. Should i just drop the entry from
pg_type or
> > should i REINDEX anyway?
>
> Well, what did you do to check that there was no entry?  If the index is
> corrupt and you issued a query that used the index, it might have failed
> to find an entry that's actually there in the table (in fact, if we're
> assuming the DROP TYPE didn't happen because the system didn't find the
> dependency row while dropping the table, this is pretty much exactly
> what you'd expect).  I'd REINDEX and then check again.

What i did so far:

$ REINDEX TABLE pg_depend

$ SELECT * from pg_depend where objid = 16562879;
 classid | objid | objsubid | refclassid | refobjid | refobjsubid | deptype
---------+-------+----------+------------+----------+-------------+---------
(0 rows)


$ SELECT * from pg_type where typname = 'temp_gc';
typname | typnamespace | typowner | typlen | typbyval | typtype | typisdefined
| typdelim | typrelid | typelem | typinput  | typoutput  | typreceive  |
typsend   | typanalyze | typalign | typstorage | typnotnull | typbasetype |
typtypmod | typndims | typdefaultbin | typdefault

---------+--------------+----------+--------+----------+---------+--------------+----------+----------+---------+-----------+------------+-------------+-------------+------------+----------+------------+------------+-------------+-----------+----------+---------------+------------
 temp_gc |        16847 |      100 |     -1 | f        | c       | t
| ,        | 16562879 |       0 | record_in | record_out | record_recv |
record_send | -          | d        | x          | f          |           0 |
-1 |        0 |               |
(1 row)


$ DROP TYPE temp_gc;
ERROR:  type "temp_gc" does not exist

> If there's no pg_depend entry then DROP TYPE should work.  Otherwise
> you might have to resort to manually DELETEing the pg_type row.

There is no pg_depend entry as far as i can tell, but DROP TYPE doesn't work.
Can i just DELETE the pg_type row now??

Sorry for asking again and again, but manipulating system catalogs seems to me
very dangerous. It's live database and i dont want to do anything wrong.

kind regards
Janning

pgsql-general by date:

Previous
From: Klint Gore
Date:
Subject: Re: MS SQL - PostgreSQL
Next
From: Bjørn T Johansen
Date:
Subject: Help trying to write my first plpgsql function...