Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g16HY1E00708 for ; Wed, 6 Feb 2002 12:34:02 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g16HY5f07625; Wed, 6 Feb 2002 12:34:05 -0500 (EST) To: Srinivasa R Chava cc: pgsql-admin@postgresql.org Subject: Re: pg_restore In-reply-to: <3C615EA9.E5A8933@wcom.com> References: <66d229f1.0202060747.39b66049@posting.google.com> <6699.1013013210@sss.pgh.pa.us> <3C615EA9.E5A8933@wcom.com> Comments: In-reply-to Srinivasa R Chava message dated "Wed, 06 Feb 2002 10:49:46 -0600" Date: Wed, 06 Feb 2002 12:34:05 -0500 Message-ID: <7622.1013016845@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200202/45 X-Sequence-Number: 3206 Srinivasa R Chava writes: > [ permissions error when restoring a sequence ] I've applied the attached patch to 7.2 sources to fix this problem. You could probably adapt it to 7.1.3 pg_dump, but I haven't looked. regards, tom lane *** src/bin/pg_dump/pg_backup_archiver.c.orig Fri Jan 18 14:18:18 2002 --- src/bin/pg_dump/pg_backup_archiver.c Wed Feb 6 12:27:50 2002 *************** *** 311,319 **** if ((reqs & REQ_SCHEMA) != 0) /* We want the schema */ { - /* Reconnect if necessary */ - _reconnectAsOwner(AH, NULL, te); - ahlog(AH, 1, "creating %s %s\n", te->desc, te->name); _printTocEntry(AH, te, ropt, false); defnDumped = true; --- 311,316 ---- *************** *** 2032,2037 **** --- 2029,2037 ---- _printTocEntry(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt, bool isData) { char *pfx; + + /* Reconnect if necessary */ + _reconnectAsOwner(AH, NULL, te); if (isData) pfx = "Data for "; *** src/bin/pg_dump/pg_dump.c.orig Fri Jan 25 13:49:31 2002 --- src/bin/pg_dump/pg_dump.c Wed Feb 6 12:27:50 2002 *************** *** 4765,4771 **** last, (called ? "true" : "false")); ArchiveEntry(fout, tbinfo.oid, tbinfo.relname, "SEQUENCE SET", NULL, ! query->data, "" /* Del */ , "", "", NULL, NULL); } if (!dataOnly) --- 4765,4772 ---- last, (called ? "true" : "false")); ArchiveEntry(fout, tbinfo.oid, tbinfo.relname, "SEQUENCE SET", NULL, ! query->data, "" /* Del */ , "", tbinfo.usename, ! NULL, NULL); } if (!dataOnly)