pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedBinary Refcursor possible?
3+ messages / 2 participants
[nested] [flat]
* Binary Refcursor possible?
@ 2005-11-23 03:39 Ralph Mason <ralph.mason@telogis.com>
0 siblings, 1 reply; 3+ messages in thread
From: Ralph Mason @ 2005-11-23 03:39 UTC (permalink / raw)
To: pgsql-performance
Hi,
I am trying to get better performance reading data from postgres, so I
would like to return the data as binary rather than text as parsing it
is taking a considerable amount of processor.
However I can't figure out how to do that! I have functions like.
function my_func(ret refcursor) returns refcursor AS
$$
BEGIN
OPEN $1 for select * from table;
return $1
END;
$$ language 'plpgsql'
There are queried using
SELECT my_func( 'ret'::refcursor); FETCH ALL FROM ret;
Is there any way I can say make ret a binary cursor?
Thanks
Ralph
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Binary Refcursor possible?
@ 2005-11-23 04:07 Tom Lane <tgl@sss.pgh.pa.us>
parent: Ralph Mason <ralph.mason@telogis.com>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2005-11-23 04:07 UTC (permalink / raw)
To: Ralph Mason <ralph.mason@telogis.com>; +Cc: pgsql-performance
Ralph Mason <ralph.mason@telogis.com> writes:
> Is there any way I can say make ret a binary cursor?
It's possible to determine that at the protocol level, if you're using
V3 protocol; but whether this is exposed to an application depends on
what client-side software you are using. Which you didn't say.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Binary Refcursor possible?
@ 2005-11-23 04:14 Ralph Mason <ralph.mason@telogis.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Ralph Mason @ 2005-11-23 04:14 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-performance
Tom Lane wrote:
> Ralph Mason <ralph.mason@telogis.com> writes:
>
>> Is there any way I can say make ret a binary cursor?
>>
>
> It's possible to determine that at the protocol level, if you're using
> V3 protocol; but whether this is exposed to an application depends on
> what client-side software you are using. Which you didn't say.
>
> regards, tom lane
>
This is probably in the documentation but I couldn't find it.
All I could see is that if you open a cursor for binary it would return
with a type of binary rather than text in the row data messages. The
RowDescription format code is always text, and the cursor thing is the
only way I could see to change that.
Is there some setting I can set that will make it return all data as
binary? The dream would also be that I could ask the server it's native
byte order and have it send me binary data in it's native byte order.
Nice and fast. :-0
Ralph
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2005-11-23 04:14 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-23 03:39 Binary Refcursor possible? Ralph Mason <ralph.mason@telogis.com>
2005-11-23 04:07 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-11-23 04:14 ` Ralph Mason <ralph.mason@telogis.com>
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