Re: BUG #1096: pg_restore cannot restore large objects with - Mailing list pgsql-bugs

From Janko Richter
Subject Re: BUG #1096: pg_restore cannot restore large objects with
Date
Msg-id 4050E4D7.9070301@yahoo.de
Whole thread Raw
In response to Re: BUG #1096: pg_restore cannot restore large objects with other oid columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #1096: pg_restore cannot restore large objects with other oid columns
Re: BUG #1096: pg_restore cannot restore large objects with
List pgsql-bugs
I have found the bug.

Unfortunately, I have a table called public.pg_proc within my database
with the same structure of pg_catalog.pg_proc. I did a test with it and
forgot to drop it.

Within postgresql-7.4.1/src/interfaces/libpq/fe-lobj.c near line 555 is
a query call as

        res = PQexec(conn, "select proname, oid from pg_proc \
                        where proname = 'lo_open'       \
                   or proname = 'lo_close'      \
                   or proname = 'lo_creat'      \
                   or proname = 'lo_unlink'     \
                   or proname = 'lo_lseek'      \
                   or proname = 'lo_tell'       \
                   or proname = 'loread'        \
                   or proname = 'lowrite'");

without a given schema. In my opinion, it must be:

res = PQexec(conn, "select proname, oid from pg_catalog.pg_proc \
 ...

I have changed it in my fe-lobj.c . Now pg_restore works well.

BTW, I have droped the my test table public.pg_proc too ;-)

Regards, Janko


Tom Lane wrote:

>"PostgreSQL Bugs List" <pgsql-bugs@postgresql.org> writes:
>
>
>>When I restore the dumped  database, pg_restore tries to restore the
>>functions of tsearch2 as a large object.
>>
>>
>
>It does what?  I don't think you're describing this accurately.  Please
>show the actual problem and not your interpretation of it.
>
>            regards, tom lane
>
>
>
--
Janko Richter

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #1100: pd_dump doesn't work with upper case table names
Next
From: Tom Lane
Date:
Subject: Re: BUG #1096: pg_restore cannot restore large objects with other oid columns