By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,541 Members | 1,525 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,541 IT Pros & Developers. It's quick & easy.

How Do I Change The 'Owner' of a Database?

P: n/a
pw
Hello,

I used a user to create a database but postgreSQL insists that the
'postgres' user is the owner. It's a bit annoying to have to change
users to link sequences to counter values.

How can I cahnge the owner of the database to the proper user?

Peter

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
* pw <p.******@telus.net> [2004-10-12 13:48:30 -0700]:
How can I cahnge the owner of the database to the proper user?


UPDATE pg_database SET datdba = (SELECT usesysid FROM pg_user WHERE
usename = 'user_name') WHERE datname = 'database_name;

There might be something you can do with 'alter database' as well.

--
Steven Klassen - Lead Programmer
Command Prompt, Inc. - http://www.commandprompt.com/
PostgreSQL Replication & Support Services, (503) 667-4564

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #2

P: n/a
pw
Thanks for your help,

I was looking at ALTER DATABASE but
the docs don't disclose any attributes
so *what the heck does one ALTER?*

I'll try the query that you offered.

Peter
Steven Klassen wrote:

There might be something you can do with 'alter database' as well.


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #3

P: n/a
* pw <p.******@telus.net> [2004-10-12 14:11:51 -0700]:
I was looking at ALTER DATABASE but the docs don't disclose any
attributes so *what the heck does one ALTER?*


The actual settings are kind of nestled in the documentation a layer
or two deep. Here are the pertinent URLs and neither of them have
anything to do with ownership, FWIW. ;)

http://www.postgresql.org/docs/curre...rdatabase.html
http://www.postgresql.org/docs/curre...me-config.html

Best Regards,

--
Steven Klassen - Lead Programmer
Command Prompt, Inc. - http://www.commandprompt.com/
PostgreSQL Replication & Support Services, (503) 667-4564

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.