pg_dump and large objects

Vadim Mikheev <vadim@sable.krasnoyarsk.su>

From: "Vadim B. Mikheev" <vadim@sable.krasnoyarsk.su>
To: hackers@postgresql.org
Date: 1998-02-25T04:01:04Z
Lists: pgsql-hackers
This is from AA van Raalte (alvin@camberlo.demon.co.uk) and shows that
we have some problems when dumping tables with LO:
> 
> 3/ The following script causes pg_dump to fail with a Segmentation fault. On my 
> system pg_dump tries to generate an index on a large object. The SELECT statement 
> in pg_dump that obtains the list of objects to be dumped explicitly rejects large 
> objects. This SELECT statement is returning an incorrect value!.
> 
> --------cut-------------
> db=testdump
> a=1
> 
> destroydb $db
> createdb $db
> psql -c "create table hobs_log1 (id text, obj oid);" $db
> 
> while [ $a -lt 100 ]; do
>         psql -c "insert into hobs_log1 (id, obj) values ('$a', lo_import('/home/alvin/pg2'));" $db
>         pg_dump $db || exit $?
>         a=`expr $a + 1`
>         done
> 
> echo success
> -------cut---------------
> 
> The following is the output of the above script on my system. 
> Note the rather garbled line containing xinv18337, this is a CREATE INDEX 
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> command and should never have been generated.
> 
> --------cut--------------
> CREATE
> INSERT 18351 1
> \connect - alvin
> CREATE TABLE hobs_log1 (id text, obj oid);
> COPY hobs_log1 FROM stdin;
> 1       18337
> \.
> @" int4_ops );xinx18337 on xinv18337 using btree ( "qdR
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> INSERT 18383 1
> \connect - alvin
> CREATE TABLE hobs_log1 (id text, obj oid);
> COPY hobs_log1 FROM stdin;
> 1       18337
> 2       18369
> \.
> ------------cut-------------

Vadim