Thread: somehow created type in4 now can't delete

somehow created type in4 now can't delete

From
"Patrick Hatcher"
Date:
Arrrrgggghhhh!!
While creating a function, I incorrectly entered int4 as in4 as the return
TYPE somehow created a TYPE in4.   I subsequently deleted the function and
recreated it with the correct int4 type.
The problem is that I cannot delete the TYPE in4 that was created.  I tried
Drop type in4, but I get a message RemoveType:  type '_in4' does not exist.
I can see in4  if I do a \dT from psql.  Furthermore, when I start
pgAdminII, and go to the database, I can no longer see my list of views
created because I get an error message: cache look up for proc 847021310
failed.
How do I remove this type?
TIA
Patrick Hatcher




Re: somehow created type in4 now can't delete

From
Tom Lane
Date:
"Patrick Hatcher" <PHatcher@macys.com> writes:
> While creating a function, I incorrectly entered int4 as in4 as the return
> TYPE somehow created a TYPE in4.   I subsequently deleted the function and
> recreated it with the correct int4 type.
> The problem is that I cannot delete the TYPE in4 that was created.  I tried
> Drop type in4, but I get a message RemoveType:  type '_in4' does not exist.

You should be able to just remove the type's row from pg_type:

    delete from pg_type where typname = 'in4';

> I can see in4  if I do a \dT from psql.  Furthermore, when I start
> pgAdminII, and go to the database, I can no longer see my list of views
> created because I get an error message: cache look up for proc 847021310
> failed.

You'll need to drop and recreate whichever view(s) refer to the old
version of that function.

            regards, tom lane

Re: somehow created type in4 now can't delete

From
"Patrick Hatcher"
Date:
Thank you!  That did it.

Patrick Hatcher
Macys.Com





                    Tom Lane
                    <tgl@sss.pgh.p       To:     "Patrick Hatcher" <PHatcher@macys.com>
                    a.us>                cc:     pgsql-novice@postgresql.org
                                         Subject:     Re: [NOVICE] somehow created type in4 now can't delete
                    03/07/2003
                    11:53 AM





"Patrick Hatcher" <PHatcher@macys.com> writes:
> While creating a function, I incorrectly entered int4 as in4 as the
return
> TYPE somehow created a TYPE in4.   I subsequently deleted the function
and
> recreated it with the correct int4 type.
> The problem is that I cannot delete the TYPE in4 that was created.  I
tried
> Drop type in4, but I get a message RemoveType:  type '_in4' does not
exist.

You should be able to just remove the type's row from pg_type:

           delete from pg_type where typname = 'in4';

> I can see in4  if I do a \dT from psql.  Furthermore, when I start
> pgAdminII, and go to the database, I can no longer see my list of views
> created because I get an error message: cache look up for proc 847021310
> failed.

You'll need to drop and recreate whichever view(s) refer to the old
version of that function.

                               regards, tom lane




XML & PostgreSQL

From
"Rosta Farzan"
Date:
Does anybody know any perl module for creating XML from PostgreSQL database?

Thanks

************************************
Rosta Farzan
Laboratory for Adaptive Hypermedia and Assistive Technologies
Department of Math and Computer Science CSU Hayward
rosta@acc.csuhayward.edu
(510) 885-4026
*************************************