BUG #1089: pg_restore fails when restoring lo.sql functions from contrib

From: "PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1089: pg_restore fails when restoring lo.sql functions from contrib
Date: 2004-03-02 20:19:50
Message-ID: 20040302201950.767B4CF4C89@www.postgresql.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 1089
Logged by: Joseph Tate

Email address: jtate(at)mi-corporation(dot)com

PostgreSQL version: 7.4

Operating system: Win32/Cygwin

Description: pg_restore fails when restoring lo.sql functions from
contrib

Details:

I've been having no end to problems with pg_dump/pg_restore. This stuff
should just work!

Execute the following as a user with createdb privs.
$ createdb test-lo
$ psql -f $CONTRIB/lo.sql -d test-lo
$ pg_dump --format=c --file=/tmp/test-lo.bak test-lo
$ dropdb test-lo
$ pg_restore -vCd template1 /tmp/test-lo.bak

This returns
pg_restore: connecting to database for restore
pg_restore: creating DATABASE test-lo
pg_restore: connecting to new database "test-lo" as user "postgres"
pg_restore: connecting to database "test-lo" as user "postgres"
pg_restore: creating ACL public
pg_restore: creating FUNCTION lo_in(cstring)
pg_restore: NOTICE: type "lo" is not yet defined
DETAIL: Creating a shell type definition.
pg_restore: creating FUNCTION lo_out(lo)
pg_restore: NOTICE: argument type lo is only a shell
pg_restore: creating TYPE lo
pg_restore: creating FUNCTION lo_oid(lo)
pg_restore: creating FUNCTION oid(lo)
pg_restore: creating CAST CAST (public.lo AS oid)
pg_restore: creating FUNCTION lo(oid)
pg_restore: creating CAST CAST (oid AS public.lo)
pg_restore: [archiver (db)] could not execute query: ERROR: function
lo(oid) does not exist
pg_restore: *** aborted because of error

To me it looks like the function is created two lines above the failure.

This works fine on Linux using 7.3.4. It also worked on 7.2.x on Cygwin.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jeff Bohmer 2004-03-02 20:48:12 Re: backend crash with certain statements/tables
Previous Message Tom Lane 2004-03-02 18:57:09 Re: backend crash with certain statements/tables