Re: PQputline in BINARY mode? - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: PQputline in BINARY mode?
Date
Msg-id 2008.1029278461@sss.pgh.pa.us
Whole thread Raw
In response to Re: PQputline in BINARY mode?  (pacquet@newsguy.com)
List pgsql-interfaces
pacquet@newsguy.com writes:
> However, this is an embedded system, so some modest amount of
> backend-hacking is quite acceptable if the payoff is large enough. Do
> you have any pointers on implementing a variant of COPY BINARY <> FROM
> file that works out of memory instead of a file?

I think what you want is to hack the fe/be protocol so you can pass
binary data in the COPY from stdin/to stdout datastream.  The problem is
that the message protocol for COPY is ASCII strings (ugh).  Change it to
be counted strings and away you go.  (There are more changes that I want
to see in this area than that, but that should get you the functionality
you want...)  backend/commands/copy.c and PQgetline/PQputline on the
frontend side are the things to look at.  Also read the SGML docs'
chapter about the fe/be protocol.
        regards, tom lane


pgsql-interfaces by date:

Previous
From: pacquet@newsguy.com
Date:
Subject: Re: PQputline in BINARY mode?
Next
From: Bruce Momjian
Date:
Subject: Re: libpgtcl modifications