8.0 beta1: pg_dump/restore failing

From: Edmund Bacon <ebacon(at)onesystem(dot)com>
To: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: 8.0 beta1: pg_dump/restore failing
Date: 2004-08-10 22:12:44
Message-ID: 4119485C.7070902@onesystem.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

pg_dump/restore in 8.0beta1 are not working well with formats other
thans plain text:

$ pg_restore --version
pg_restore (PostgreSQL) 8.0.0beta1
$ pg_dump --version
pg_dump (PostgreSQL) 8.0.0beta1

$ createdb test_8
CREATE DATABASE
$ createlang plpgsql test_8

$ psql test_8 -c \
> " create function foo() returns int as 'begin return 1; end;'
language 'plpgsql'"
CREATE FUNCTION

$ psql test_8 -c "select foo()";
foo
-----
1
(1 row)

$ pg_dump --format=c --file=test_8.dump test_8

$ pg_restore --format=c --clean --dbname=test_8 test_8.dump
pg_restore: [archiver (db)] could not execute query: ERROR: schema
"public" does not exist
pg_restore: [archiver (db)] could not execute query: ERROR: schema
"public" does not exist
pg_restore: [archiver (db)] could not execute query: ERROR: schema
"public" does not exist
pg_restore: [archiver (db)] could not execute query: ERROR:
unterminated dollar-quoted string at or near "$$begin return 1;" at
character 115
pg_restore: WARNING: there is no transaction in progress
pg_restore: [archiver (db)] could not execute query: ERROR:
unterminated dollar-quoted string at or near "$$
LANGUAGE plpgsql;" at character 1
pg_restore: [archiver (db)] could not execute query: ERROR: schema
"public" does not exist
pg_restore: [archiver (db)] could not execute query: ERROR: schema
"public" does not exist
pg_restore: [archiver (db)] could not execute query: ERROR: schema
"public" does not exist
pg_restore: [archiver (db)] could not execute query: ERROR: schema
"public" does not exist
pg_restore: [archiver (db)] could not execute query: ERROR: schema
"public" does not exist
--
-- PostgreSQL database dump complete
--

WARNING, errors ignored on restore: 10
$

Note that there was a problem restoring the function.
Did --clean remove the public schema?
Hmm ... maybe there's a problem with --clean

$ dropdb test_8
DROP DATABASE
$ pg_restore --format=c --create --dbname=test test_8.dump
pg_restore: [archiver (db)] could not execute query: ERROR:
unterminated dollar-quoted string at or near "$$begin return 1;" at
character 115
pg_restore: WARNING: there is no transaction in progress
pg_restore: [archiver (db)] could not execute query: ERROR:
unterminated dollar-quoted string at or near "$$
LANGUAGE plpgsql;" at character 1
pg_restore: [archiver (db)] could not execute query: ERROR: function
public.foo() does not exist
--
-- PostgreSQL database dump complete
--

WARNING, errors ignored on restore: 3
$

Yep, but we still can't restore the function.

tests with format=t show the same behaviour.
tests with format=p succeed

--
Edmund Bacon <ebacon(at)onesystem(dot)com>

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Adam Witney 2004-08-10 22:16:23 Re: OSX problem with make check...
Previous Message Tom Lane 2004-08-10 21:19:54 Re: OSX problem with make check...