Bug #533: BLOB (lo type) objects could not be restored

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #533: BLOB (lo type) objects could not be restored
Date: 2001-12-09 10:54:26
Message-ID: 200112091054.fB9AsQw49982@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Stefan Hadjistoytchev (sth(at)hq(dot)bsbg(dot)net) reports a bug with a severity of 1
The lower the number the more severe it is.

Short Description
BLOB (lo type) objects could not be restored

Long Description
Hi :)

Problem appeared in POSTGRESQL 7.2b3 CVS distribution

After creating a table containing BLOB (lo type) column and filling it in an error occured restoring this table using "pg_restore":

ERROR: Unable to identify an operator '=' for types 'oid' and 'lo'
You will have to retype this query using an explicit cast

Using Postgres 7.1.3 - there is no such error :(, but I need 7.2
because there are other fixes in it and I need them.

Please, see example:

Sample Code
-- user root
-- in postgres 7.2.b3 directory

./configure
./gmake
./gmake install

chmod -R 777 /usr/local/pgsql

-- user postgres

cd /usr/local/pgsql/bin
./initdb -D /usr/local/pgsql/data

-- ACTION: change access permissions in /usr/local/pgsql/data/pg_hba.conf to allow access

./postmaster -D /usr/local/pgsql/data -i &
./createdb test
./psql -f test1.sql test

>-- test1.sql contains:
>
>CREATE TYPE lo (
> internallength=4, externallength=10,
> input=int4in, output=int4out,
> default='', passedbyvalue
>);
>
>CREATE TABLE "tb_snimki" (
> "egn" varchar(10) NOT NULL,
> "img" lo
>-- CONSTRAINT "snimki_pkey" PRIMARY KEY ("egn")
>);

-- ACTION: After this I inserted 1 small BLOB object (10K) in "tb_snimki"
-- from another PC with "egn" = "1234"

./pg_dump -b -Fc test > dump1.bin
./dropdb test
./createdb test

./pg_restore -v -Fc -d test dump1.bin

-- RESULT:
pg_restore: connecting to database for restore
pg_restore: creating TYPE lo
pg_restore: creating TABLE tb_snimki
pg_restore: restoring data for table tb_snimki
pg_restore: restoring data for table BLOBS
pg_restore: connecting to database test as user postgres
pg_restore: creating table for large object cross-references
pg_restore: restored 1 large objects
pg_restore: fixing up large object cross-reference for tb_snimki
pg_restore: fixing large object cross-references for tb_snimki.img
pg_restore: [archiver (db)] error while updating column "img" of table "tb_snimki":
ERROR: Unable to identify an operator '=' for types 'oid' and 'lo'
You will have to retype this query using an explicit cast
pg_restore: *** aborted because of error

No file was uploaded with this report

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2001-12-09 20:21:48 Re: Bug #532: backend crashes due to segmentation fault
Previous Message pgsql-bugs 2001-12-08 16:42:47 Bug #532: backend crashes due to segmentation fault

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2001-12-09 15:24:53 ECPG is okay again
Previous Message Manuel Sugawara 2001-12-09 01:41:01 Re: date formatting and tab-complete patch