Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 7C70B1337BEB for ; Sat, 2 Apr 2011 19:41:31 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 16084-10 for ; Sat, 2 Apr 2011 22:41:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id C88D61337BDA for ; Sat, 2 Apr 2011 19:41:23 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p32MfMov001844; Sat, 2 Apr 2011 18:41:22 -0400 (EDT) To: "Per-Olov Esgard" cc: pgsql-bugs@postgresql.org Subject: Re: BUG #5959: pg_restore --use-list does not always work with a pg_restore generated TOC file In-reply-to: <201103301039.p2UAd8DS034876@wwwmaster.postgresql.org> References: <201103301039.p2UAd8DS034876@wwwmaster.postgresql.org> Comments: In-reply-to "Per-Olov Esgard" message dated "Wed, 30 Mar 2011 10:39:08 +0000" Date: Sat, 02 Apr 2011 18:41:21 -0400 Message-ID: <1843.1301784081@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/9 X-Sequence-Number: 29928 "Per-Olov Esgard" writes: > 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. Hm. The function only cares about the dump ID at the start of the line. AFAICS the consequence of buffer overflow would be that it'd take a line continuation as a new line; which would generally result in a harmless "WARNING: line ignored" message. You didn't say exactly what symptom you were seeing, but "does not work" seems like a bit of an overstatement for that. So I'm wondering whether you're seeing some behavior I'm missing. regards, tom lane