Skip site navigation (1) Skip section navigation (2)

Re: PQputline in BINARY mode?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pacquet(at)newsguy(dot)com
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: PQputline in BINARY mode?
Date: 2002-08-13 22:41:01
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
pacquet(at)newsguy(dot)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

In response to

pgsql-interfaces by date

Next:From: Bruce MomjianDate: 2002-08-14 05:43:18
Subject: Re: libpgtcl modifications
Previous:From: pacquetDate: 2002-08-13 22:15:11
Subject: Re: PQputline in BINARY mode?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group