|
Home > Archive > PostgreSQL Newbies > June 2005 > Steps taken through while transmitting binary data
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Steps taken through while transmitting binary data
|
|
| Volkan YAZICI 2005-06-13, 3:23 am |
| Hi,
What's the difference between server/client binary data conversions
[1] of these commands:
i. "COPY ... TO ... WITH BINARY ..."
ii. "DECLARE ... BINARY ..."
iii. PQexecParams(..., 1)
AFAIC, the method followed in (i) and (ii) is (omiting byte order conversions):
{server| binary} -> {client| binary}
But in the way as (iii) (which requires proto 3.0):
{server| binary -> char} -> {client| char -> binary}
To summarize, I wonder the handling steps taken through while
transmitting binary data. (I tried to figure it out from source code
by myself, but couldn't reach an answer.) Does it work as i tried to
explain above while using PQexecParams()? Namely do we require dummy
conversions while gathering binary data with PQexecParams()?
I'd be so appreciated for any kind of explanation.
Regards.
[1] « Normal cursors return data in text format, the same as a SELECT
would produce. Since data is stored natively in binary format, the
system must do a _conversion_ to produce the text format. Once the
information comes back in text form, the client application may need
to _convert_ it to a binary format to manipulate it.» [from
doc/sql-copy.html]
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere
" to majordomo@postgresql
.org)
| |
| Tom Lane 2005-06-13, 9:23 am |
| Volkan YAZICI <volkan.yazici@gmail.com> writes:
> What's the difference between server/client binary data conversions
> [1] of these commands:
> i. "COPY ... TO ... WITH BINARY ..."
> ii. "DECLARE ... BINARY ..."
> iii. PQexecParams(..., 1)
None. They all return the result data in whatever binary format is
defined by the datatypes' "send" procedures.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere
" to majordomo@postgresql
.org)
|
|
|
|
|