pg_loopen() error

From: Louis Bertrand <louis(at)bertrandtech(dot)on(dot)ca>
To: pgsql-php(at)postgresql(dot)org
Subject: pg_loopen() error
Date: 2001-01-12 04:17:22
Message-ID: Pine.BSO.4.20.0101112302080.6558-100000@grendel.bts
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Hello all,

I'm trying to pull a LO out of a database (7.0.2) on OpenBSD 2.7 with
PHP 3.0.18 + Apache 1.3.12, except I keep getting this error:

Connection="6"
ObjectID="19766"
Warning: Unable to open PostgresSQL large object in
/var/www/htdocs/secure/whdb-test/download.php3 on line 81

Handle=""
PostgreSQL error="ERROR: lo_lseek: invalid large obj descriptor (0) "

The code fragment is:
echo "<br>Connection=\"$conn\"";
echo "<br>ObjectID=\"$objectid\"";
$handle = pg_loopen( $conn, $objectid, "r");
echo "<br>Handle=\"$handle\"";
echo "<br>PostgreSQL error=\"".pg_ErrorMessage($conn)."\"";

The LO is there, really!
I can use \lo_export to put it on local disk (diff checks it OK), and the
connection is valid because I pull the objectid out of another table where
objectid is declared as type OID.

Any clues? Known bug in pg_loopen? Pilot error?

Sign me stumped
--Louis <louis(at)bertrandtech(dot)on(dot)ca>

Louis Bertrand http://www.bertrandtech.on.ca/
Bertrand Technical Services, Bowmanville, ON, Canada
Tel: +1.905.623.1500 Fax: +1.905.623.3852

OpenBSD: Secure by default. http://www.openbsd.org/

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Louis Bertrand 2001-01-12 04:34:04 Re: ODBC ... cont
Previous Message Stephen van Egmond 2001-01-12 04:10:08 Re: pg_loopen() error