pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: lindebg <lindebg@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: BUG #6299: pg_dump, pg_dumpall - Problem with the order of backup functions
Date: Thu, 17 Nov 2011 20:54:15 GMT
Message-ID: <201111172054.pAHKsFc7052692@wwwmaster.postgresql.org> (raw)


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



view thread (7+ messages)  latest in thread

Message-ID: <201111172054.pAHKsFc7052692@wwwmaster.postgresql.org>
Permalink:  ../201111172054.pAHKsFc7052692@wwwmaster.postgresql.org/
Also on:    postgresql.org/message-id/201111172054.pAHKsFc7052692@wwwmaster.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: lindebg@gmail.com
  Subject: Re: BUG #6299: pg_dump, pg_dumpall - Problem with the order of backup functions
  In-Reply-To: <201111172054.pAHKsFc7052692@wwwmaster.postgresql.org>
  References: <201111172054.pAHKsFc7052692@wwwmaster.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox