Re: [GENERAL] ownership of DBs and tables?

From: Jim Richards <grumpy(at)cyber4(dot)org>
To: Louis Bertrand <louis(at)bertrandtech(dot)on(dot)ca>
Cc: pgsql-general(at)hub(dot)org
Subject: Re: [GENERAL] ownership of DBs and tables?
Date: 2000-02-17 03:19:39
Message-ID: 200002170322.WAA15509@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

At 09:58 PM 16/02/00 -0500, you wrote:
>Is there a way of changing the ownership of tables and even entire
>databases?

Um, after the table has been created no, but you can set up users and
accounts, so as you, try (in ksh, not sure about others)

PGUSER=postgres PGPASSWORD=postgres psql template1

then

create user www with password "www";

then when you want to run scripts, or connect then you can with

PGUSER=www PGPASSSWORD=www psql -f filename.sql webdb

or interactively

PGUSER=www PGPASSSWORD=www psql webdb

>\i filename.sql

>Here's why I ask. I created a database "webdb" for a PHP3 application and
>created a database user "www" to own it. However, I am creating the actual
>tables as user "louis" who has superuser privileges in PostgreSQL. When
>I look at the ownership of a new table, it's "louis", not "www". I'm
>doing this with psql and pgaccess. I'd rather not have to su(8) as
>"www" to perform DB maintenance.

--
An army marches as fast as its slowest stomach.
Mr Grumpy - what are you on about?
http://www.cyber4.org/members/grumpy/index.html

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Louis Bertrand 2000-02-17 04:15:54 Re: [GENERAL] ownership of DBs and tables?
Previous Message Louis Bertrand 2000-02-17 02:58:15 ownership of DBs and tables?