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 data

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

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

2011-11-15 Thread Tom Lane
Robert Haas writes: > On Tue, Nov 15, 2011 at 10:36 AM, Alvaro Herrera > 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 >>> categ

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

2011-11-15 Thread Dimitri Fontaine
Robert Haas 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 noncompatible mode

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 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 wrote: >> > Pavel Stehule writes: >> >> there is a request on enhancing of pg_backup to produce a conditional >> >> DROP

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 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 better. > > I think

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 wrote: > > Pavel Stehule 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 dynami

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 wrote: > Pavel Stehule 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 "--con

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

2011-11-15 Thread Pavel Stehule
2011/11/15 Tom Lane : > Pavel Stehule 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_

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

2011-11-15 Thread Tom Lane
Pavel Stehule 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 produce a DROP IF

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

2011-11-15 Thread Torello Querci
2011/11/15 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 p

[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 instea