Thread: What is the format of 'binary' data in the postgresql client/server protocol version 3

Guys,

 I am in the middle of implementing postgresql's client server
protocol and I have run into a little issue. The spec says that in
general data can be of two types, 'text' and 'binary'. The text one is
generally pretty simple to figure out. However, there doesn't seem to
be any area of the docs that details format for 'binary' data. For
example, how do you serialize a float? How about an decimal type?,
etc.

I hope my question is clear and I look forward to your responses.

Thanks,
Eric
--
I'm a programmer, I don't have to spell correctly; I just have to
spell consistently

Eric Merritt <cyberlync@gmail.com> writes:
>  I am in the middle of implementing postgresql's client server
> protocol and I have run into a little issue. The spec says that in
> general data can be of two types, 'text' and 'binary'. The text one is
> generally pretty simple to figure out. However, there doesn't seem to
> be any area of the docs that details format for 'binary' data.

Generally you have to look at the send/recv routines for the specific
data type that you are wondering about.  Sooner or later the comments on
those routines should be transposed into the SGML documentation, but it
hasn't happened yet.

(There's still a strong streak of "use the source, Luke" in this
community, if you hadn't noticed...)

            regards, tom lane

On Mon, 24 Jan 2005 18:54:01 -0500, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Eric Merritt <cyberlync@gmail.com> writes:
> >  I am in the middle of implementing postgresql's client server
> > protocol and I have run into a little issue. The spec says that in
> > general data can be of two types, 'text' and 'binary'. The text one is
> > generally pretty simple to figure out. However, there doesn't seem to
> > be any area of the docs that details format for 'binary' data.
>
> Generally you have to look at the send/recv routines for the specific
> data type that you are wondering about.

 Ik, ok I can do that. Any pointers to the particular sourcefile these
are implemented in?

> Sooner or later the comments on
> those routines should be transposed into the SGML documentation, but it
> hasn't happened yet.
>
> (There's still a strong streak of "use the source, Luke" in this
> community, if you hadn't noticed...)

 Yea, but its all C and C hurts my eyes. ;)

Eric Merritt <cyberlync@gmail.com> writes:
> On Mon, 24 Jan 2005 18:54:01 -0500, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Generally you have to look at the send/recv routines for the specific
>> data type that you are wondering about.

>  Ik, ok I can do that. Any pointers to the particular sourcefile these
> are implemented in?

They're pretty much all under src/backend/utils/adt/

            regards, tom lane

Re: What is the format of 'binary' data in the postgresql client/server protocol version 3

From
"Frank D. Engel, Jr."
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

O, I C -- and agree!

Unfortunately, though, I don't see many people jumping at the chance to
translate all of this open source code into a more readable language
(such as Pascal or Ada).

And I haven't found (or written) that English compiler I've been
wanting yet....  although some of the Xtalk languages (HyperTalk,
Transcript, etc.) get rather close sometimes, depending on what you are
trying to do.

Hmm...  Actually, now that I google it again:

http://www.iagora.com/~espel/pleng


On Jan 24, 2005, at 7:41 PM, Eric Merritt wrote:
>>
>> (There's still a strong streak of "use the source, Luke" in this
>> community, if you hadn't noticed...)
>
>  Yea, but its all C and C hurts my eyes. ;)
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>
- -----------------------------------------------------------
Frank D. Engel, Jr.  <fde101@fjrhome.net>

$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep "John 3:16"
John 3:16 For God so loved the world, that he gave his only begotten
Son, that whosoever believeth in him should not perish, but have
everlasting life.
$
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFB9mE57aqtWrR9cZoRAsPyAJ9LOY4Wg6RDfT8P7365Zo4Kj8V+QACfej/t
fHowlts3f4OQ7vuSJefUF10=
=ioBA
-----END PGP SIGNATURE-----



___________________________________________________________
$0 Web Hosting with up to 120MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com