Re: Question about todo item - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Question about todo item
Date
Msg-id 4825.996981099@sss.pgh.pa.us
Whole thread Raw
In response to Re: Question about todo item  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Question about todo item
Re: Question about todo item
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I keep bugging Jan about it, since pre-7.1 and no one has come up with
> an idea.

Well, if you want an idea:
BEGIN;
SELECT open_toast_object(toastable_column) FROM tab WHERE ...;
-- app checks that it got exactly one result back
-- app lo_reads and/or lo_writes using ID returned by SELECT
END;

Implementation is left as an exercise for the reader ;-).

Offhand this seems like it would be doable for a column-value that
was actually moved out-of-line by TOAST, since the open_toast_object
function could see and return the TOAST pointer, and then the read/
write operations just hack on rows in pg_largeobject.  The hard part
is how to provide equivalent functionality (transparent to the client
of course) when the particular value you select has *not* been moved
out-of-line.  Ideas anyone?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Question about todo item
Next
From: Bruce Momjian
Date:
Subject: Re: Question about todo item