Bug #546: un-pg_restore-able pg_dump

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #546: un-pg_restore-able pg_dump
Date: 2001-12-31 16:50:03
Message-ID: 200112311650.fBVGo3i80681@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

mike south (msouth(at)fulcrum(dot)org) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
un-pg_restore-able pg_dump

Long Description
HI,

I'm trying to do a dump/restore on a database.

I created the dump like this:
pg_dump -u -Fc db_xref_qa >db_xref_qa.dump

I attempted to restore it like this:

[postgres(at)chef postgres]$ pg_restore -u -Fc -d remove_this_db db_xref_qa.dump

and this is the output:

Username: postgres
Password:

Connecting to remove_this_db as postgres
Password:

Connecting to remove_this_db as kerneladmin
Password:

NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'kernel_maker_pkey' for table 'kernel_maker'
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'kernel_status_pkey' for table 'kernel_status'
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'kernel_pkey' for table 'kernel'
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'netraverse_kernel_pkey' for table 'netraverse_kernel'
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'obsolete_kernel_group_pkey' for table 'obsolete_kernel_group'
NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'stock_kernel_pkey' for table 'stock_kernel'
Connecting to remove_this_db as postgres
Password:

Archiver(db): Could not execute query. Code = 7. Explanation from backend: 'ERROR: Relation 'test2' does not exist
'.

I also did a plain dump ( pg_dump -u db_xref_qa >db_xref_qa.plaindump ), and when I looked through it I noticed (I gather from the bug reporting instructions that I am not supposed to speculate about what the problem is, so you may stop reading now) that the lines to create the ACL entry on the view "test2" came before the lines that created the view "test2".

An excerpt from db_xref_qa.plaindump, in which TOC entry ID 24 precedes TOC Entry ID 23, (which looked odd to me, but what do I know?):

[begin excerpt]--
-- TOC Entry ID 24 (OID 187523)
--
-- Name: test2 Type: ACL Owner:
--

REVOKE ALL on "test2" from PUBLIC;
GRANT ALL on "test2" to "postgres";
GRANT ALL on "test2" to "kerneladmin";

--
-- TOC Entry ID 23 (OID 187533)
--
-- Name: test2 Type: VIEW Owner: postgres
--

CREATE VIEW "test2" as ((SELECT [end excerpt]

I have the full dump, both with -Fc and plain, at

http://fulcrum.org/test/db_xref_qa.dump.gz

and

http://fulcrum.org/test/db_xref_qa.plaindump.gz

in case that might be helpful.

mike

Sample Code

No file was uploaded with this report

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2001-12-31 17:16:36 Re: Bug #546: un-pg_restore-able pg_dump
Previous Message Bruce Momjian 2001-12-29 20:40:13 Re: Bug #534: factorial function