Re: Inefficient escape codes.

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Rodrigo Madera <rodrigo(dot)madera(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Inefficient escape codes.
Date: 2005-10-18 19:03:24
Message-ID: 20051018190324.GA92715@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Michael Fuhr 2005-10-18 20:47:27 Re: Inefficient escape codes.
Previous Message Rodrigo Madera 2005-10-18 18:07:12 Inefficient escape codes.