pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Mead <scottm@openscg.com>
To: Andy Nercessian <ahnercessian@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: pg_dump bug?
Date: Tue, 11 Apr 2017 06:33:33 -0400
Message-ID: <9E1C43FE-68CD-4661-98E9-2E682723EB08@openscg.com> (raw)
In-Reply-To: <CAJWczd9Z-3vHrv3nF1z-tRUEUbCSSW=ynsbrqt1mY5TWXBE26Q@mail.gmail.com>
References: <CAJWczd9Z-3vHrv3nF1z-tRUEUbCSSW=ynsbrqt1mY5TWXBE26Q@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>



> On Apr 11, 2017, at 05:20, Andy Nercessian <ahnercessian@gmail.com> wrote:
> 
> I wonder if anyone has experienced the problem I have with bloated pg_dump files. This problem exists in both standard pg_dumps and --insert-columns type pg_dumps. I am using postgresql 9.5 on Windows 7.
> 
> Each table appears to have a 'copy table_name .... from stdin..' in multiple places (hundreds in some cases). The first copy statement appears genuine, but the second and subsequent statements appear to be in the middle of another copy clause between records. The outer copy clause is sometimes from the same table, and sometimes from a different table. Furthermore, from the existence of the number of backslashes \t, \\t, \\\\t which are variable, it would appear as though nesting can be several levels deep.
> 
> I'm not copying the actual data because apart from anything else, it's a giant text file. But this is roughly what it looks like:
> 
> ------------------------------------
> copy bills from .... 
> Record 1 Column 1 \t Record 1 column 2 \t ....
> Record 2 Column 2 \t Record 2 column 2 \t ...
> ......
> copy adverts from .... < this is a nested copy statement unrelated to bills, although occasionally it's another bills copy statement>
> 
> Record 88 Column 1 \t Record 88 Column 2 \t ...
> 
> -------------------------------------
> 
> So in the middle of one copy statement - in between the records being copied, another one mysteriously appears and the records are duplicated. Each record can therefore be found in each of the copy statements, and the total number of such duplications is in the hundreds for some tables.
> 
> What could be causing this? I've made only the following observations:
> 1. The nested loops always occur in the same spot within the outer copy statements (if records have not changed between dumps) and are preceded by the exact same column of the same record in each dump.
> 2. It is clear that these copy statements are NOT part of any record. 
> 3. The same behaviour exists for insert style dumps (where there is no copy command).
> 4. Each copy statement includes the entire table, NOT a selection of records from it.
> 
> In years of using pg_dump I have never come across this issue. 

Is it possible that you have more than 1 pg_dump running simultaneously against the same output file?



> 
> 
> -- 
> Andy 


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (4+ messages)  latest in thread

Message-ID: <9E1C43FE-68CD-4661-98E9-2E682723EB08@openscg.com>
Permalink:  ../9E1C43FE-68CD-4661-98E9-2E682723EB08@openscg.com/
Also on:    postgresql.org/message-id/9E1C43FE-68CD-4661-98E9-2E682723EB08@openscg.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: scottm@openscg.com, ahnercessian@gmail.com
  Subject: Re: pg_dump bug?
  In-Reply-To: <9E1C43FE-68CD-4661-98E9-2E682723EB08@openscg.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox