[HACKERS] [ patch ] pg_dump: new --custom-fetch-table and--custom-fetch-value parameters - Mailing list pgsql-hackers

From Andrea Urbani
Subject [HACKERS] [ patch ] pg_dump: new --custom-fetch-table and--custom-fetch-value parameters
Date
Msg-id trinity-95e5c1d2-4c8f-46b2-a40c-4c629d91cfb1-1482337328474@3capp-mailcom-lxa07
Whole thread Raw
Responses Re: [HACKERS] [ patch ] pg_dump: new --custom-fetch-table and--custom-fetch-value parameters
List pgsql-hackers
Hello to everybody,
I had a problem with a Postgresql 9.3.5 on 32 bit linux, old 2.6.26 kernel:
Program: pg_dump
Problem: if you have tables with big blob fields and you try to dump them with --inserts you could get errors like
    pg_dump: [archiver (db)] query failed: lost synchronization with server: got message type "D", length 847712348
    pg_dump: [archiver (db)] query was: FETCH 100 FROM _pg_dump_cursor
    or
    pg_dump: [archiver (db)] query failed: ERROR:  out of memory
    DETAIL:  Failed on request of size 1073741823.
    pg_dump: [archiver (db)] query was: FETCH 100 FROM _pg_dump_cursor
    
I have solve it adding two new parameters, --custom-fetch-table and --custom-fetch-value, to fetch less records for the specified table(s).
This does not completely solve the problem, but it helps you to get more chance to be able to dump your database.
    pg_dump --dbname=healthorganizer --username=hor --column-inserts --custom-fetch-table='"tDocumentsFiles"' --custom-fetch-value=25
I haven't tested the documentation: too many problems while building it (also the original version, without my changes; probably I have bogus tools... and too less time to check/try...).
Attached the patches for the master and REL9_6_STABLE.
I hope it will help somebody else.
 
Bye
Andrea
matfanjol@users.sf.net
 
Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] Hang in pldebugger after git commit : 98a64d0
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] Logical decoding on standby