pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: pg_loopen() error
3+ messages / 2 participants
[nested] [flat]

* Re: pg_loopen() error
@ 2001-01-12 04:10  Stephen van Egmond <svanegmond@bang.dhs.org>
  parent: Louis Bertrand <louis@bertrandtech.on.ca>
  0 siblings, 1 reply; 3+ messages in thread

From: Stephen van Egmond @ 2001-01-12 04:10 UTC (permalink / raw)
  To: Louis Bertrand <louis@bertrandtech.on.ca>; +Cc: pgsql-php

Louis Bertrand (louis@bertrandtech.on.ca) wrote:
> Any clues? Known bug in pg_loopen? Pilot error?

I think large objects need to be read in a begin/end block.  The
annotated PHP covers this in the user comments...



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pg_loopen() error
@ 2001-01-12 04:17  Louis Bertrand <louis@bertrandtech.on.ca>
  0 siblings, 1 reply; 3+ messages in thread

From: Louis Bertrand @ 2001-01-12 04:17 UTC (permalink / raw)
  To: 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@bertrandtech.on.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/






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pg_loopen() error
@ 2001-01-12 04:55  Louis Bertrand <louis@bertrandtech.on.ca>
  parent: Stephen van Egmond <svanegmond@bang.dhs.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Louis Bertrand @ 2001-01-12 04:55 UTC (permalink / raw)
  To: svanegmond@home.com; +Cc: pgsql-php

Stephen,

Thanks! That was it. 

A quick check of the code for how psql does it also confirms that!
(src/bin/psql/large_obj.c)

Ciao
 --Louis  <louis@bertrandtech.on.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/

On Thu, 11 Jan 2001, Stephen van Egmond wrote:

> Louis Bertrand (louis@bertrandtech.on.ca) wrote:
> > Any clues? Known bug in pg_loopen? Pilot error?
> 
> I think large objects need to be read in a begin/end block.  The
> annotated PHP covers this in the user comments...
> 




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2001-01-12 04:55 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-01-12 04:17 pg_loopen() error Louis Bertrand <louis@bertrandtech.on.ca>
2001-01-12 04:10 ` Stephen van Egmond <svanegmond@bang.dhs.org>
2001-01-12 04:55   ` Louis Bertrand <louis@bertrandtech.on.ca>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox