Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id E8C801337B67 for ; Wed, 30 Mar 2011 07:39:08 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 66245-08 for ; Wed, 30 Mar 2011 10:39:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id 434931337B2F for ; Wed, 30 Mar 2011 07:39:08 -0300 (ADT) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id p2UAd8Bw034877 for ; Wed, 30 Mar 2011 10:39:08 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id p2UAd8DS034876; Wed, 30 Mar 2011 10:39:08 GMT (envelope-from www) Date: Wed, 30 Mar 2011 10:39:08 GMT Message-Id: <201103301039.p2UAd8DS034876@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #5959: pg_restore --use-list does not always work with a pg_restore generated TOC file From: "Per-Olov Esgard" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201103/378 X-Sequence-Number: 29888 The following bug has been logged online: Bug reference: 5959 Logged by: Per-Olov Esgard Email address: Per-Olov.Esgard@micronic-mydata.com PostgreSQL version: 9.0.0 Operating system: Linux / kernel 2.6.16.20 Description: pg_restore --use-list does not always work with a pg_restore generated TOC file Details: General ======= In my application I am using automatically generated psm:s. These psm: are using many arguments, in some cases over 80. This means that a TOC entry in a TOC file generated by pg_restore --list may be very long for psm:s with such a long signature. Specific ======== My backup system makes a schema dump to a file and a data dump to another file. When performing a restore I create a TOC list from the schema dump by using pg_restore on the schema dump file. I do some filtering on the TOC file and then I restore it using pg_restore --use-list. This does not work since some entries in the TOC file are more than 2000 characters long. The function SortTocFromFile in pg_backup_archiver.c has a hard coded limitation of 1024 characters for each row in the TOC file. Temporary solution ================== I have now solved this problem in my application by extending the buffer to 4096 characters and recompiled pg_restore.