random access - bytea - Mailing list pgsql-hackers

From Dennis Bjorklund
Subject random access - bytea
Date
Msg-id Pine.LNX.4.44.0310251715300.23254-100000@zigo.dhs.org
Whole thread Raw
Responses Re: random access - bytea  (Joe Conway <mail@joeconway.com>)
List pgsql-hackers
There have been (in the past at least) plans on adding a random access
interface to bytea fields. I don't find it in the todo, maybe it should be
added?

What kind of syntax have people thought about, to let the client read a
bytea field in a random access way? I'm thinking of something like:

BEGIN;

SELECT id, open_bytea(bytea_field, READ_ACCESS) FROM table;

... and then the client has to access the data in the same transaction,
using the ID returned by open_bytea() ...

COMMIT;

Would that be feasible? I think it looks like a clean solution. To me 
it seems that accessing the data outside a transaction would not be 
something we want anyway, right?

Sematically it's easier to implement read access then write access. For
write access to work with transactions one need for example the blocks in
a bytea field to be stored with the transaction id's an stuff (I don't
know these parts of pg internals well enough yet).

One other thing I don't know well enough yet is the new wire protocol. To 
support something like above, would it need to be changed? I guess so if 
it wasn't designed with this in mind.

-- 
/Dennis



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Call for port reports
Next
From: Bruce Momjian
Date:
Subject: Re: Call for port reports