Re: Bug in RENAME TO? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bug in RENAME TO?
Date
Msg-id 26739.1087063349@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bug in RENAME TO?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Bug in RENAME TO?  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
I said:
> It's likely that there are some pg_proc entries that you can break the
> system beyond repair by renaming, but I'd expect they are a relatively
> small minority (the system's hardwired references are by OID not name).

Just for fun I tried

d=# update pg_proc set proname = 'z' || proname;
UPDATE 1727

The database got a bit unpleasant to use, mainly because most of
psql's \d commands broke:

d=# \d foo
ERROR:  function pg_catalog.pg_table_is_visible(oid) does not exist

but standard SQL operations still worked, and in fact I was able to
undo the damage with

d=# update pg_proc set proname = zsubstring(proname,2);
UPDATE 1727

So I say there isn't any reason to prohibit renaming functions just
because they were created at initdb time.  The worst-case scenario
is you have to rename 'em back.  Likewise for ALTER OWNER.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Nested xacts: looking for testers and review
Next
From: "Carl E. McMillin"
Date:
Subject: Re: I just got it: PostgreSQL Application Server -- a new project.