Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 2D26310D80A1 for ; Thu, 17 Nov 2011 16:54:29 -0400 (AST) Received: from wwwmaster.postgresql.org ([217.196.146.204]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RR8ya-0000WL-Tz for pgsql-bugs@postgresql.org; Thu, 17 Nov 2011 20:54:29 +0000 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 pAHKsFmN052693 for ; Thu, 17 Nov 2011 20:54:15 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id pAHKsFc7052692; Thu, 17 Nov 2011 20:54:15 GMT (envelope-from www) Date: Thu, 17 Nov 2011 20:54:15 GMT Message-Id: <201111172054.pAHKsFc7052692@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #6299: pg_dump, pg_dumpall - Problem with the order of backup functions From: "lindebg" Content-Type: text/plain; charset=utf-8 X-Archive-Number: 201111/128 X-Sequence-Number: 31723 The following bug has been logged online: Bug reference: 6299 Logged by: lindebg Email address: lindebg@gmail.com PostgreSQL version: 9.0, 9.1 Operating system: Linux, Windows Description: pg_dump, pg_dumpall - Problem with the order of backup functions Details: 1. create database test and functions fn2, fn1: $ psql -c "create database test" $ psql test test=# create function fn2() returns int as $$ select 1 $$ language sql immutable; create function fn1(param1 int default fn2()) returns int as $$ select $1 $$ language sql immutable; \q 2. backup: pg_dump -F c > test.backup 3. clear database: psql -c "drop database test" psql -c "create database test" 4. restore database: pg_restore -d test test.backup Errors: pg_restore: [archiver (db)] Error while PROCESSING TOC: pg_restore: [archiver (db)] Error from TOC entry 221; 1255 21043 FUNCTION fn1(integer) postgres pg_restore: [archiver (db)] could not execute query: ERROR: function fn2() does not exist LINE 1: CREATE FUNCTION fn1(param1 integer DEFAULT fn2()) RETURNS in... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. Command was: CREATE FUNCTION fn1(param1 integer DEFAULT fn2()) RETURNS integer LANGUAGE sql IMMUTABLE AS $_$ select $1 $_$; pg_restore: [archiver (db)] could not execute query: ERROR: function public.fn1(integer) does not exist Command was: ALTER FUNCTION public.fn1(param1 integer) OWNER TO postgres; WARNING: errors ignored on restore: 2