Re: [GENERAL] ownership of DBs and tables? - Mailing list pgsql-general

From Jim Richards
Subject Re: [GENERAL] ownership of DBs and tables?
Date
Msg-id 200002170322.WAA15509@hub.org
Whole thread Raw
In response to ownership of DBs and tables?  (Louis Bertrand <louis@bertrandtech.on.ca>)
Responses Re: [GENERAL] ownership of DBs and tables?  (Louis Bertrand <louis@bertrandtech.on.ca>)
Re: [GENERAL] ownership of DBs and tables?  (Karl DeBisschop <kdebisschop@range.infoplease.com>)
List 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


pgsql-general by date:

Previous
From: Louis Bertrand
Date:
Subject: ownership of DBs and tables?
Next
From: Louis Bertrand
Date:
Subject: Re: [GENERAL] ownership of DBs and tables?