X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 5553FD1B440 for ; Wed, 31 Dec 2003 16:57:00 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 07659-07 for ; Wed, 31 Dec 2003 12:56:10 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 981BAD1B480 for ; Wed, 31 Dec 2003 12:56:09 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id hBVGu719010983; Wed, 31 Dec 2003 11:56:07 -0500 (EST) To: Kris Kiger Cc: pgsql-admin@postgresql.org Subject: Re: dump contents & missing functions In-reply-to: <3FF2F4BD.5000804@musicrebellion.com> References: <20031015011052.GA8143@miltonstreet.com> <1066228820.24290.275.camel@linda.lfix.co.uk> <3FF2F4BD.5000804@musicrebellion.com> Comments: In-reply-to Kris Kiger message dated "Wed, 31 Dec 2003 11:09:33 -0500" Date: Wed, 31 Dec 2003 11:56:07 -0500 Message-ID: <10982.1072889767@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/355 X-Sequence-Number: 11861 Kris Kiger writes: > This whole issue arose when I set a default in a table row equal to a > value that a plpgsql function returns (ie the table default = > functionname(variable)). However, after exploration of the dump files, > it appears that pg_restore tries to restore the tables before it > restores functions...hence I get an error upon restore of the original > dump, because the function does not yet exist. Does anyone know if the > ordering of the restore is in fact the problem? Any input is appreciated! pg_restore has facilities for telling it to restore the dump contents in a particular order (basically, get a table-of-contents listing and then edit the listing). I don't think it works to hack the tar file directly. Also you could try using development tip pg_dump, which should get the dump order right to begin with. AFAIK it will work okay with a 7.4 server. regards, tom lane