Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2016-05-31 Thread Hendrik Visage
Hi there, Refering to https://www.postgresql.org/message-id/1352742344.21373.4@mofo I'm running into situations where I'd need to bulk transfer of data tables across servers, but a drop and recreate schema isn't feasible as we are running different permissions etc. on the two databases. Thus

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-12-04 Thread Karl O. Pinc
On 12/04/2012 09:26:47 PM, Josh Kupershmidt wrote: > Sorry for the delay in following up here. No problem at all. > Well, as far as I was able to tell, the use-case where this patch > worked without trouble was limited to restoring a table, or schema > with table(s), that: > a.) has some view(s)

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-12-04 Thread Josh Kupershmidt
Sorry for the delay in following up here. On Mon, Nov 26, 2012 at 8:30 PM, Karl O. Pinc wrote: > On 11/26/2012 08:45:08 PM, Josh Kupershmidt wrote: >> On Mon, Nov 26, 2012 at 3:42 PM, Robert Haas >> wrote: >> > On Mon, Nov 26, 2012 at 4:51 PM, Karl O. Pinc wrote: >> >> P.S. An outstanding ques

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-11-26 Thread Karl O. Pinc
On 11/26/2012 09:30:48 PM, Karl O. Pinc wrote: > On 11/26/2012 08:45:08 PM, Josh Kupershmidt wrote: > > It is a common administrative task to selectively restore some > > existing tables' contents from a backup, and IIRC was the impetus > for > > this patch. > > Yes. (And aside from listing tabl

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-11-26 Thread Karl O. Pinc
On 11/26/2012 08:45:08 PM, Josh Kupershmidt wrote: > On Mon, Nov 26, 2012 at 3:42 PM, Robert Haas > wrote: > > On Mon, Nov 26, 2012 at 4:51 PM, Karl O. Pinc wrote: > >> P.S. An outstanding question regards --truncate-tables > >> is whether it should drop indexes before truncate > >> and re-creat

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-11-26 Thread Josh Kupershmidt
On Mon, Nov 26, 2012 at 3:42 PM, Robert Haas wrote: > On Mon, Nov 26, 2012 at 4:51 PM, Karl O. Pinc wrote: >> P.S. An outstanding question regards --truncate-tables >> is whether it should drop indexes before truncate >> and re-create them after restore. Sounds like it should. > > Well, that wo

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-11-26 Thread Robert Haas
On Mon, Nov 26, 2012 at 4:51 PM, Karl O. Pinc wrote: > Where I would like to go with this is to first introduce, > as a new patch, an ALTER TABLE option to disable a > constraint. Something like > > ALTER TABLE foo UNVALIDATE CONSTRAINT "constraintname"; This doesn't really make sense, because

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-11-26 Thread Karl O. Pinc
On 11/26/2012 12:06:56 PM, Robert Haas wrote: > On Wed, Nov 21, 2012 at 12:53 AM, Josh Kupershmidt > wrote: > > TBH, I didn't find the example above particularly compelling for > > demonstrating the need for this feature. If you've just got one > table > > with dependent views which needs to be re

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-11-26 Thread Robert Haas
On Wed, Nov 21, 2012 at 12:53 AM, Josh Kupershmidt wrote: > TBH, I didn't find the example above particularly compelling for > demonstrating the need for this feature. If you've just got one table > with dependent views which needs to be restored, it's pretty easy to > manually TRUNCATE and have p

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-11-23 Thread Josh Kupershmidt
On Wed, Nov 21, 2012 at 5:48 AM, Karl O. Pinc wrote: >> On Fri, Sep 21, 2012 at 8:54 AM, Karl O. Pinc wrote: >> > On 09/20/2012 12:24:49 PM, Karl O. Pinc wrote: > OT: > After looking at the code I found a number of "conflicting" > option combinations are not tested for or rejected. I can't >

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-11-21 Thread Karl O. Pinc
Hi Josh, On 11/20/2012 11:53:23 PM, Josh Kupershmidt wrote: > Hi Karl, > I signed on to review this patch for the current CF. I noticed. Thanks very much. > On Fri, Sep 21, 2012 at 8:54 AM, Karl O. Pinc wrote: > > On 09/20/2012 12:24:49 PM, Karl O. Pinc wrote: > > First, the problem: > > > >

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-11-20 Thread Josh Kupershmidt
Hi Karl, I signed on to review this patch for the current CF. Most of the background for the patch seems to be in the message below, so I'm going to respond to this one first. On Fri, Sep 21, 2012 at 8:54 AM, Karl O. Pinc wrote: > On 09/20/2012 12:24:49 PM, Karl O. Pinc wrote: > >> I've had probl

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-11-12 Thread Karl O. Pinc
Hi, Attached is version 4. Version 3 no longer built against head. On 10/16/2012 09:48:06 PM, Karl O. Pinc wrote: > > On 09/23/2012 08:52:07 PM, Karl O. Pinc wrote: > > > On 09/23/2012 12:24:27 AM, Karl O. Pinc wrote: > > > > On 09/23/2012 12:19:07 AM, Karl O. Pinc wrote: > > > > On 09/21/201

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-10-16 Thread Karl O. Pinc
Hi, Attached is version 3. The convention seems to be to leave the operator at the end of the line when breaking long lines, so do that. Add extra () -- make operator precedence explicit and have indentation reflect operator precedence. On 09/23/2012 08:52:07 PM, Karl O. Pinc wrote: > On 09/23/

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-09-23 Thread Karl O. Pinc
Attached is version 2. The sgml did not build. On 09/23/2012 12:24:27 AM, Karl O. Pinc wrote: > Whoops. Do over. Sent the wrong file. > > On 09/23/2012 12:19:07 AM, Karl O. Pinc wrote: > > On 09/21/2012 10:54:05 AM, Karl O. Pinc wrote: > > > On 09/20/2012 12:24:49 PM, Karl O. Pinc wrote: > > >

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-09-22 Thread Karl O. Pinc
Whoops. Do over. Sent the wrong file. On 09/23/2012 12:19:07 AM, Karl O. Pinc wrote: > On 09/21/2012 10:54:05 AM, Karl O. Pinc wrote: > > On 09/20/2012 12:24:49 PM, Karl O. Pinc wrote: > > > > > I've had problems using pg_restore --data-only when > > > restoring individual schemas (which contai

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-09-22 Thread Karl O. Pinc
On 09/21/2012 10:54:05 AM, Karl O. Pinc wrote: > On 09/20/2012 12:24:49 PM, Karl O. Pinc wrote: > > > I've had problems using pg_restore --data-only when > > restoring individual schemas (which contain data which > > has had bad things done to it). --clean does not work > > well because of depend

Re: [HACKERS] Suggestion for --truncate-tables to pg_restore

2012-09-21 Thread Karl O. Pinc
On 09/20/2012 12:24:49 PM, Karl O. Pinc wrote: > I've had problems using pg_restore --data-only when > restoring individual schemas (which contain data which > has had bad things done to it). --clean does not work > well because of dependent objects in other schemas. Before doing any more work I

[HACKERS] Suggestion for --truncate-tables to pg_restore

2012-09-20 Thread Karl O. Pinc
Hi, I've had problems using pg_restore --data-only when restoring individual schemas (which contain data which has had bad things done to it). --clean does not work well because of dependent objects in other schemas. Patch to the docs attached (before I go and do any real coding.) Karl Free S