pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Rodrigo Madera <rodrigo.madera@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Inefficient escape codes.
Date: Tue, 18 Oct 2005 13:03:24 -0600
Message-ID: <20051018190324.GA92715@winnie.fuhr.org> (raw)
In-Reply-To: <3cf983d0510181107sb060171je702da5fe0c29252@mail.gmail.com>
References: <3cf983d0510181107sb060171je702da5fe0c29252@mail.gmail.com>

On Tue, Oct 18, 2005 at 06:07:12PM +0000, Rodrigo Madera wrote:
> 1) Is there any way for me to send the binary field directly without needing
> escape codes?

In 7.4 and later the client/server protocol supports binary data
transfer.  If you're programming with libpq you can use PQexecParams()
to send and/or retrieve values in binary instead of text.

http://www.postgresql.org/docs/8.0/interactive/libpq-exec.html#LIBPQ-EXEC-MAIN

APIs built on top of libpq or that implement the protcol themselves
might provide hooks to this capability; check your documentation.
What language and API are you using?

See also COPY BINARY:

http://www.postgresql.org/docs/8.0/interactive/sql-copy.html

> 2) Will this mean that the client actually wastes my network bandwidth
> converting binary data to text? Or does the client transparently manage
> this?

Binary transfer sends data in binary, not by automatically converting
to and from text.

-- 
Michael Fuhr



view thread (9+ messages)  latest in thread

Message-ID: <20051018190324.GA92715@winnie.fuhr.org>
Permalink:  ../20051018190324.GA92715@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20051018190324.GA92715@winnie.fuhr.org

 · 

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-performance@postgresql.org
  Cc: mike@fuhr.org, rodrigo.madera@gmail.com
  Subject: Re: Inefficient escape codes.
  In-Reply-To: <20051018190324.GA92715@winnie.fuhr.org>

* 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