Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id BA81D133798E for ; Fri, 18 Feb 2011 06:59:33 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 58026-08 for ; Fri, 18 Feb 2011 10:59:25 +0000 (UTC) X-Greylist: delayed 01:07:20.141524 by SQLgrey-1.7.6 Received: from gauss.credativ.com (gauss.credativ.com [93.94.130.89]) by mail.postgresql.org (Postfix) with ESMTP id 0FB821336FA7 for ; Fri, 18 Feb 2011 06:59:25 -0400 (AST) Received: from [172.26.14.237] (exit.credativ.com [87.139.82.80]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: aha@gauss.credativ.com) by gauss.credativ.com (Postfix) with ESMTPSA id D07661B42A1 for ; Fri, 18 Feb 2011 09:48:38 +0100 (CET) Message-ID: <4D5E3264.7060705@credativ.de> Date: Fri, 18 Feb 2011 09:48:36 +0100 From: Arnd Hannemann User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: postgresql 9.0.3: parallel restore fails with comments on indices Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201102/160 X-Sequence-Number: 29432 Hi, postgres version: 9.0.3 OS: debian squeeze 64bit if pg_restore is used with -jN it fails if the dump has comments on indices. Steps to reproduce (db testdb): CREATE DATABASE testdb; \c testdb CREATE TABLE tab (id INT); INSERT INTO tab VALUES (1); CREATE INDEX idx ON tab USING btree (id); COMMENT ON INDEX idx IS 'first index'; (pgsql-pg_9.0.3)aha@abt:~/bin$ pg_restore --version pg_restore (PostgreSQL) 9.0.3 (pgsql-pg_9.0.3)aha@abt:~/bin$ pg_dump -F c testdb > testdb.pg_dump (pgsql-pg_9.0.3)aha@abt:~/bin$ pg_restore -j2 -c -d testdb testdb.pg_dump ERROR: relation "idx" does not exist STATEMENT: COMMENT ON INDEX idx IS 'first index'; pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 1784; 0 0 COMMENT INDEX idx aha pg_restore: [archiver (db)] could not execute query: ERROR: relation "idx" does not exist Command was: COMMENT ON INDEX idx IS 'first index'; WARNING: errors ignored on restore: 1 (pgsql-pg_9.0.3)aha@abt:~/bin$ pg_restore -c -d testdb testdb.pg_dump (pgsql-pg_9.0.3)aha@abt:~/bin$ echo $? 0 The problem seems to be a false assumption in pg_backup_archiver.c: 3200 for (next_work_item = AH->toc->next; next_work_item != AH->toc; next_work_item = next_work_item->next) 3201 { 3202 /* Non-PRE_DATA items are just ignored for now */ 3203 if (next_work_item->section == SECTION_DATA || 3204 next_work_item->section == SECTION_POST_DATA) 3205 continue; 3206 3207 ahlog(AH, 1, "processing item %d %s %s\n", 3208 next_work_item->dumpId, 3209 next_work_item->desc, next_work_item->tag); 3210 3211 (void) restore_toc_entry(AH, next_work_item, ropt, false); 3212 3213 /* there should be no touch of ready_list here, so pass NULL */ 3214 reduce_dependencies(AH, next_work_item, NULL); 3215 } Comments are in SECTION_NONE so they get restored here regardless of dependencies, which is obviously wrong because the comment on an INDEX depends on the INDEX itself and the INDEX is in SECTION_POST_DATA Best regards Arnd -- Arnd Hannemann credativ GmbH, HRB Mönchengladbach 12080 Hohenzollernstr. 133, 41061 Mönchengladbach Geschäftsführung: Dr. Michael Meskes, Jörg Folz