pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
libpq, large Objects
5+ messages / 3 participants
[nested] [flat]

* libpq, large Objects
@ 1999-06-20 19:54  John Huttley <john@mwk.co.nz>
  0 siblings, 1 reply; 5+ messages in thread

From: John Huttley @ 1999-06-20 19:54 UTC (permalink / raw)
  To: pgsql-interfaces

I've been programming with libpq and things have been
working quite well.

There are two puzzles though.

How do you destroy a large_object?
AFAIK, the only way to do it is to put its OID into a tuple in a table and
then delete that tuple.


How do you truncate a large_object?

Regards,

John





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

* Re: [INTERFACES] libpq, large Objects
@ 1999-06-20 23:28  Tom Lane <tgl@sss.pgh.pa.us>
  parent: John Huttley <john@mwk.co.nz>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 1999-06-20 23:28 UTC (permalink / raw)
  To: John Huttley <john@mwk.co.nz>; +Cc: pgsql-interfaces

"John Huttley" <john@mwk.co.nz> writes:
> How do you destroy a large_object?

lo_unlink(oid_of_large_object)

> AFAIK, the only way to do it is to put its OID into a tuple in a table and
> then delete that tuple.

AFAIK, that will *not* remove the LO, just the referencing tuple ...

> How do you truncate a large_object?

I don't believe there's any way to do that.  It's an oversight, for
sure.

			regards, tom lane



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

* Re: [INTERFACES] libpq, large Objects
@ 1999-06-22 04:42  John Huttley <john@mwk.co.nz>
  0 siblings, 0 replies; 5+ messages in thread

From: John Huttley @ 1999-06-22 04:42 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-interfaces


-----Original Message-----
From: Tom Lane <tgl@sss.pgh.pa.us>
To: John Huttley <john@mwk.co.nz>
Cc: PGSQL-Interfaces <pgsql-interfaces@postgreSQL.org>
Date: Monday, 21 June 1999 11:30
Subject: Re: [INTERFACES] libpq, large Objects


>"John Huttley" <john@mwk.co.nz> writes:
>> How do you destroy a large_object?
>
>lo_unlink(oid_of_large_object)


Thanks


>> AFAIK, the only way to do it is to put its OID into a tuple in a table
and
>> then delete that tuple.
>
>AFAIK, that will *not* remove the LO, just the referencing tuple ...
>




Thats pretty weird. Would Vaccum detect and remove orphaned OID's?

Regards






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

* Re: [INTERFACES] libpq, large Objects
@ 1999-06-22 04:45  John Huttley <john@mwk.co.nz>
  0 siblings, 0 replies; 5+ messages in thread

From: John Huttley @ 1999-06-22 04:45 UTC (permalink / raw)
  To: spertus@ella.mills.edu; +Cc: pgsql-interfaces


-----Original Message-----
From: spertus@ella.mills.edu <spertus@ella.mills.edu>
To: John Huttley <john@mwk.co.nz>
Date: Monday, 21 June 1999 11:06
Subject: Re: [INTERFACES] libpq, large Objects


>> I've been programming with libpq and things have been
>> working quite well.
>
>Were you able to get blobtest to work?
>
> Ellen
>

I dont know what blobtest is.

However I was able to store LO data in a tuple using the lo_import function.

Then in my program, I malloc'd a storage area and was able to read the
object into it.
It needs lo_tell to find out how big it is.

I don't need to do any random reads or write to LO's.

Regards






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

* RE: [INTERFACES] libpq, large Objects
@ 1999-06-22 08:55  Peter Mount <petermount@it.maidstone.gov.uk>
  0 siblings, 0 replies; 5+ messages in thread

From: Peter Mount @ 1999-06-22 08:55 UTC (permalink / raw)
  To: 'John Huttley' <john@mwk.co.nz>; spertus@ella.mills.edu; +Cc: pgsql-interfaces

blobtest is one of the JDBC large object examples. I think the libpq
equivalents are called something else.

Peter

-- 
Peter Mount
Enterprise Support
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council.


-----Original Message-----
From: John Huttley [mailto:john@mwk.co.nz]
Sent: Tuesday, June 22, 1999 5:46 AM
To: spertus@ella.mills.edu
Cc: PGSQL-Interfaces
Subject: Re: [INTERFACES] libpq, large Objects



-----Original Message-----
From: spertus@ella.mills.edu <spertus@ella.mills.edu>
To: John Huttley <john@mwk.co.nz>
Date: Monday, 21 June 1999 11:06
Subject: Re: [INTERFACES] libpq, large Objects


>> I've been programming with libpq and things have been
>> working quite well.
>
>Were you able to get blobtest to work?
>
> Ellen
>

I dont know what blobtest is.

However I was able to store LO data in a tuple using the lo_import
function.

Then in my program, I malloc'd a storage area and was able to read the
object into it.
It needs lo_tell to find out how big it is.

I don't need to do any random reads or write to LO's.

Regards






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


end of thread, other threads:[~1999-06-22 08:55 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-06-20 19:54 libpq, large Objects John Huttley <john@mwk.co.nz>
1999-06-20 23:28 ` Tom Lane <tgl@sss.pgh.pa.us>
1999-06-22 04:42 Re: [INTERFACES] libpq, large Objects John Huttley <john@mwk.co.nz>
1999-06-22 04:45 Re: [INTERFACES] libpq, large Objects John Huttley <john@mwk.co.nz>
1999-06-22 08:55 RE: [INTERFACES] libpq, large Objects Peter Mount <petermount@it.maidstone.gov.uk>

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