pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Changing owner of function -- best method?
3+ messages / 3 participants
[nested] [flat]

* Changing owner of function -- best method?
@ 2003-06-05 15:06  Josh Berkus <josh@agliodbs.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Josh Berkus @ 2003-06-05 15:06 UTC (permalink / raw)
  To: pgsql-sql

Folks,

I have several functions in a 7.2.4 database that I accidentally REPLACEd 
while logged in as the superuser, instead of the db owner.   As a result, the 
db owner can no longer modify those functions -- they belong to the 
superuser.

As this is a production database, I can't drop the functions and re-create 
them as a different user ... the interruption in service would not be 
acceptable.   I was wondering whether there were any problems with either of 
the following methods:

A)  Updating the pg_proc table to change the function owner;
B)  Making the db_owner a superuser, replacing the functions, and then making 
the db_owner a non-superuser again.

BTW, is there a neater method to deal with this in 7.4?   7.2 and 7.3 have 
ALTER TABLE ... CHANGE OWNER, but other types of objects don't seem to have a 
CHANGE OWNER option.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Changing owner of function -- best method?
@ 2003-06-06 13:52  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Josh Berkus <josh@agliodbs.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2003-06-06 13:52 UTC (permalink / raw)
  To: Josh Berkus <josh@agliodbs.com>; +Cc: pgsql-sql

Josh Berkus <josh@agliodbs.com> writes:
> A)  Updating the pg_proc table to change the function owner;

That seems safe enough.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Changing owner of function -- best method?
@ 2003-06-06 14:42  Dmitry Tkach <dmitry@openratings.com>
  parent: Josh Berkus <josh@agliodbs.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Dmitry Tkach @ 2003-06-06 14:42 UTC (permalink / raw)
  To: Josh Berkus <josh@agliodbs.com>; +Cc: pgsql-sql

Josh Berkus wrote:

>Folks,
>
>I have several functions in a 7.2.4 database that I accidentally REPLACEd 
>while logged in as the superuser, instead of the db owner.   As a result, the 
>db owner can no longer modify those functions -- they belong to the 
>superuser.
>
>As this is a production database, I can't drop the functions and re-create 
>them as a different user ... the interruption in service would not be 
>acceptable.   I was wondering whether there were any problems with either of 
>the following methods:
>
>A)  Updating the pg_proc table to change the function owner;
>B)  Making the db_owner a superuser, replacing the functions, and then making 
>the db_owner a non-superuser again.
>  
>
I believe, either of two should work. I have done it many times in the 
past...

Dima





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2003-06-06 14:42 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-06-05 15:06 Changing owner of function -- best method? Josh Berkus <josh@agliodbs.com>
2003-06-06 13:52 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-06-06 14:42 ` Dmitry Tkach <dmitry@openratings.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox