BUG #6299: pg_dump, pg_dumpall - Problem with the order of backup functions

From: "lindebg" <lindebg(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6299: pg_dump, pg_dumpall - Problem with the order of backup functions
Date: 2011-11-17 20:54:15
Message-ID: 201111172054.pAHKsFc7052692@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 6299
Logged by: lindebg
Email address: lindebg(at)gmail(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2011-11-18 00:42:18 Re: BUG #6299: pg_dump, pg_dumpall - Problem with the order of backup functions
Previous Message Flávio Alves Granato 2011-11-17 20:31:42 Re: CREATE ROLE jdbc vs pgadmin