Re: pg_dump and grants to PUBLIC

From: John Purser <jmpurser(at)gmail(dot)com>
To: Blair Lowe <postgresql(at)zedemail(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump and grants to PUBLIC
Date: 2006-05-08 22:04:42
Message-ID: 20060508150442.39647a75.jmpurser@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 08 May 2006 15:47:13 -0600
Blair Lowe <postgresql(at)zedemail(dot)ca> wrote:

> Hi,
>
> I have had this problem for a while, and have not been able to find
> anything in the archives or on search engines:
>
> If I want to back up a client's database on our shared web server, I
> would type:
>
> pg_dump <database_name>
>
> Since we are running a shared server, and since crappy (only because
> of this problem) off the shelf database open source software such as
> oscommerce, or phpBB2 grants access to public rather than the web user
> "www" or "nobody", when I do a pg_dump for a database, I get all the
> databases on the system that grant to PUBLIC being dumped with with
> database that I want.
>
> To restore, I need to go in and prune out all the extra junk that was
> granted to PUBLIC by other users in other databases - very time
> consuming.
>
> How can I use pg_dump to get JUST the database in th argument, and not
> other tables and databases that have granted to PUBLIC?
>
> Altering my client's software to grant to "nobody" is not practical.
>
> Thanks in advance,
> Blair.
>
>
> ---------------------------(end of
> broadcast)--------------------------- TIP 2: Don't 'kill -9' the
> postmaster

Blair,

<UNTESTED>
How about setting up a seperate schema (private), adding your
customer's database to it (leaving it in public) and then backing up
private.customerdb?
</UNTESTED>

John Purser

--
You need more time; and you probably always will.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-05-08 22:09:31 Re: pg_dump and grants to PUBLIC
Previous Message Blair Lowe 2006-05-08 21:47:13 pg_dump and grants to PUBLIC