Re: [HACKERS] ToDo: pg_backup - using a conditional DROP

2011-11-21 Thread Pavel Stehule
Hello There is a use case from GoodData's engineer --- We have many user projects, each project has his own database with granted permissions. We use pg_dump with option --clean which extends SQL dump with syntax like: DROP INDEX tab1_idx1; DROP TABLE tab1; When we load such dump into database

Re: [HACKERS] ToDo: pg_backup - using a conditional DROP

2011-11-16 Thread Peter Eisentraut
On tis, 2011-11-15 at 22:27 -0500, Tom Lane wrote: Now, --clean using DROP IF EXISTS would be targeted at, um, what case? I guess the idea is to be able to load into a database that sort of mostly shares the same schema as the one you dumped from, only it's not the same (if it were the same,

[HACKERS] ToDo: pg_backup - using a conditional DROP

2011-11-15 Thread Pavel Stehule
Hello, there is a request on enhancing of pg_backup to produce a conditional DROPs. A reason for this request is more simple usage in very dynamic production - cloud BI solution. pg_backup can have a new option --conditional-drops and then pg_dump will produce a DROP IF EXISTS statements instead

Re: [HACKERS] ToDo: pg_backup - using a conditional DROP

2011-11-15 Thread Torello Querci
2011/11/15 Pavel Stehule pavel.steh...@gmail.com: Hello, there is a request on enhancing of pg_backup to produce a conditional DROPs. A reason for this request is more simple usage in very dynamic production - cloud BI solution. pg_backup can have a new option --conditional-drops and then

Re: [HACKERS] ToDo: pg_backup - using a conditional DROP

2011-11-15 Thread Tom Lane
Pavel Stehule pavel.steh...@gmail.com writes: there is a request on enhancing of pg_backup to produce a conditional DROPs. A reason for this request is more simple usage in very dynamic production - cloud BI solution. pg_backup can have a new option --conditional-drops and then pg_dump will

Re: [HACKERS] ToDo: pg_backup - using a conditional DROP

2011-11-15 Thread Pavel Stehule
2011/11/15 Tom Lane t...@sss.pgh.pa.us: Pavel Stehule pavel.steh...@gmail.com writes: there is a request on enhancing of pg_backup to produce a conditional DROPs. A reason for this request is more simple usage in very dynamic production - cloud BI solution. pg_backup can have a new option

Re: [HACKERS] ToDo: pg_backup - using a conditional DROP

2011-11-15 Thread Robert Haas
On Tue, Nov 15, 2011 at 9:14 AM, Tom Lane t...@sss.pgh.pa.us wrote: Pavel Stehule pavel.steh...@gmail.com writes: there is a request on enhancing of pg_backup to produce a conditional DROPs. A reason for this request is more simple usage in very dynamic production - cloud BI solution.

Re: [HACKERS] ToDo: pg_backup - using a conditional DROP

2011-11-15 Thread Alvaro Herrera
Excerpts from Robert Haas's message of mar nov 15 11:59:17 -0300 2011: On Tue, Nov 15, 2011 at 9:14 AM, Tom Lane t...@sss.pgh.pa.us wrote: Pavel Stehule pavel.steh...@gmail.com writes: there is a request on enhancing of pg_backup to produce a conditional DROPs. A reason for this request is

Re: [HACKERS] ToDo: pg_backup - using a conditional DROP

2011-11-15 Thread Robert Haas
On Tue, Nov 15, 2011 at 10:36 AM, Alvaro Herrera alvhe...@commandprompt.com wrote: I'm wondering why we need an option for this, though.  Assuming we make DROP IF EXISTS work anywhere that it doesn't already, why not just always produce that rather than straight DROP?  It seems categorically

Re: [HACKERS] ToDo: pg_backup - using a conditional DROP

2011-11-15 Thread Christopher Browne
On Tue, Nov 15, 2011 at 10:36 AM, Alvaro Herrera alvhe...@commandprompt.com wrote: Excerpts from Robert Haas's message of mar nov 15 11:59:17 -0300 2011: On Tue, Nov 15, 2011 at 9:14 AM, Tom Lane t...@sss.pgh.pa.us wrote: Pavel Stehule pavel.steh...@gmail.com writes: there is a request on

Re: [HACKERS] ToDo: pg_backup - using a conditional DROP

2011-11-15 Thread Dimitri Fontaine
Robert Haas robertmh...@gmail.com writes: I wonder if that instead of trying to remain somewhat compatible to other systems we should instead have a mode specifically designed for that --one which didn't output SET or backslash commands, used inserts rather than COPY, etc-- and have the

Re: [HACKERS] ToDo: pg_backup - using a conditional DROP

2011-11-15 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Tue, Nov 15, 2011 at 10:36 AM, Alvaro Herrera alvhe...@commandprompt.com wrote: I'm wondering why we need an option for this, though. Assuming we make DROP IF EXISTS work anywhere that it doesn't already, why not just always produce that rather