Re: pg_dump and grants to PUBLIC - Mailing list pgsql-general

From Blair Lowe
Subject Re: pg_dump and grants to PUBLIC
Date
Msg-id 1147130374.16012.59.camel@localhost.localdomain
Whole thread Raw
In response to Re: pg_dump and grants to PUBLIC  ("Joshua D. Drake" <jd@commandprompt.com>)
Responses Re: pg_dump and grants to PUBLIC
Re: pg_dump and grants to PUBLIC
List pgsql-general
On Mon, 2006-08-05 at 15:54 -0700, Joshua D. Drake wrote:
> > Not sure how else to describe this: basically if you type in pg_dump
> > <databasename> then all databases on the system that have table grants
> > to public are also in the backup .sql file with connect commands to the
> > other database users.
>
> Do you mean pg_dumpall? Because pg_dump will ONLY dump the database you
> specify, nothing else.

That would be nice, but it is not true.

Try this:

as user1: createdb test1
psql test1
>create table stuff1 (
  a CHAR(3)
);

as user2: createdb test2
pgsql test2
>create table stuff2 (
  a CHAR(3)
);
>grant all on stuff2 to PUBLIC;

now again as user1:
pg_dump test1

You should see the table stuff2 of test2 in there.

phpBB2 and many other mysql based software packages grant all tables to
PUBLIC so that the web user can alter stuff.

Blair.


pgsql-general by date:

Previous
From: Casey Duncan
Date:
Subject: Re: What is your favorite front end for user interaction to postgresql databases?
Next
From: Tom Lane
Date:
Subject: Re: pg_dump and grants to PUBLIC