Re: Post Install / Secure PostgreSQL

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Carlos Mennens <carlos(dot)mennens(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Post Install / Secure PostgreSQL
Date: 2010-09-13 19:15:36
Message-ID: AANLkTinwXanus_9S0kW353-Cv9zrAVNCmj8WCY7fn5x6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Sep 13, 2010 at 12:24 PM, Carlos Mennens
<carlos(dot)mennens(at)gmail(dot)com> wrote:
> On Mon, Sep 13, 2010 at 1:57 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I also noticed that I created a database called 'ide' in PostgreSQL as
> the 'postgres' super user and I am trying to change the owner of the
> database to me <cmennens> and when I run the following command, I
> don't get an error but the owner doesn't appear to change for some
> reason. What am I doing wrong?
>
> ide=# \c ide
> psql (8.4.4)
> You are now connected to database "ide".
>
> ide=# ALTER DATABASE ide OWNER TO cmennens;
> ALTER DATABASE
>
> ide=# \dt
>         List of relations
>  Schema | Name  | Type  |  Owner
> --------+-------+-------+----------
>  public | users | table | postgres
> (1 row)
>
> Any ideas if I am missing something here?
>
> Thank you very much for all your support so far!

The table owner isn't the same as the db owner. Whoever created the
table owns it. Try \l to see a list of databases.

Also note that instead of reassigning all those table owners by name
you can grant membership of a user to that "role":

grant ide to myrole;

--
To understand recursion, one must first understand recursion.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2010-09-13 21:58:13 Re: Schema search path
Previous Message Carlos Mennens 2010-09-13 18:24:08 Re: Post Install / Secure PostgreSQL