pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pacquet@newsguy.com
Cc: pgsql-interfaces@postgresql.org
Subject: Re: PQputline in BINARY mode?
Date: Tue, 13 Aug 2002 18:41:01 -0400
Message-ID: <2008.1029278461@sss.pgh.pa.us> (raw)
In-Reply-To: <200208132215.PAA79633@newsguy.com>
References: <200208132215.PAA79633@newsguy.com>

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



view thread (4+ messages)

Message-ID: <2008.1029278461@sss.pgh.pa.us>
Permalink:  ../2008.1029278461@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2008.1029278461@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pacquet@newsguy.com
  Subject: Re: PQputline in BINARY mode?
  In-Reply-To: <2008.1029278461@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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