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

unable to set 'Owner' column to different role

P: 1
I'm currently following the book: Beginning Databases with PostgreSQL, From Novice to Professional with Postgresql-8.2.0-1 Chapter 4, page 76: Accessing You Data. Having followed the book's instuctions, I've set up two roles: One as 'Mikael' and another as 'Rick' (with Mikael having permission to create Db's and new roles and Rick only having permission to create Db's) and created and populated a simple database called bpsimple. Using PSQL I'm now supposed to log on as Rick in order to work with the database's table, and when I do so I get: You are now connected to database "bpsimple" as user "rick".
bpsimple=>, which is fine. However, when I type: \dt to print out the table: I get the following:
List of relations
Schema | Name | Type | Owner
public | barcode | table | Mikael
public | customer | table | Mikael
public | item | table | Mikael
public | orderinfo | table | Mikael
public | orderline | table | Mikael
public | stock | table | Mikael

Here 'Owner' is supposed to read Rick not Mikael. Is there a way to change it? What am I doing wrong?

Thanks in advance,

Jan 12 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 534
CREATE TABLE creates a new table in the current database.
The table will be owned by the user issuing the command.

(this does not mean that other users will not be able to access this table)

If you need to change the owner of the table you can do something like this:
Expand|Select|Wrap|Line Numbers
  1. ALTER TABLE table_name OWNER TO new_owner;

for details see the PostgreSQL docs:
Jan 12 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.