Unix Technical Forum

streaming access to bytea data

This is a discussion on streaming access to bytea data within the pgsql Interfaces jdbc forums, part of the PostgreSQL category; --> Hi all, I've got a couple questions regarding bytea columns and streaming. 1 - Does Postgres server load the ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces jdbc

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-15-2008, 11:58 PM
David Durham
 
Posts: n/a
Default streaming access to bytea data

Hi all,

I've got a couple questions regarding bytea columns and streaming.

1 - Does Postgres server load the entire bytea column before sending to
clients?

Might not be the right list for the previous question, but I thought
someone might know.

2 - Does the current postgres jdbc driver support streaming reads/writes
of bytea columns? I saw in the archives that someone submitted a patch
for streaming writes, but I didn't see anything regarding reads.

If the jdbc driver doesn't currently support streaming reads, are there
any plans to add this feature? Any particular technical hurdles?

Thanks,


Dave

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-15-2008, 11:58 PM
Kris Jurka
 
Posts: n/a
Default Re: streaming access to bytea data



On Fri, 17 Mar 2006, David Durham wrote:

> 1 - Does Postgres server load the entire bytea column before sending to
> clients?


Yes.

> Might not be the right list for the previous question, but I thought someone
> might know.
>
> 2 - Does the current postgres jdbc driver support streaming reads/writes of
> bytea columns? I saw in the archives that someone submitted a patch for
> streaming writes, but I didn't see anything regarding reads.


The JDBC driver can stream the write to the server, but the server will
still read the entire stream before writing it to disk, so it's a client
only streaming.

> If the jdbc driver doesn't currently support streaming reads, are there any
> plans to add this feature? Any particular technical hurdles?
>


The JDBC driver doesn't support streaming reads, nor does any other client
interface. You would need to extend the frontend/backend protocol to
return some sort of pointer to the bytea reference rather than the whole
thing. This will still require the server to store the whole bytea result
somewhere to allow it to be pointed to.

Perhaps you should think about using large objects instead of bytea?

Kris Jurka


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-15-2008, 11:58 PM
David Durham
 
Posts: n/a
Default Re: streaming access to bytea data

Kris Jurka wrote:
> On Fri, 17 Mar 2006, David Durham wrote:
>
>> 1 - Does Postgres server load the entire bytea column before sending
>> to clients?

>
> Yes.


ok

> The JDBC driver doesn't support streaming reads, nor does any other
> client interface. You would need to extend the frontend/backend
> protocol to return some sort of pointer to the bytea reference rather
> than the whole thing. This will still require the server to store the
> whole bytea result somewhere to allow it to be pointed to.
>
> Perhaps you should think about using large objects instead of bytea?


Thanks for the quick response, and the exact information that I needed.
Unfortunately large objects don't work with Slony replication.

Thanks again,

Dave

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:39 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com