X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 12FABD70A2 for ; Tue, 18 Oct 2005 16:03:45 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 42837-04 for ; Tue, 18 Oct 2005 19:03:41 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 1DE1ED6ED4 for ; Tue, 18 Oct 2005 16:03:41 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j9IJ3Pub093362 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 18 Oct 2005 13:03:27 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.4/8.13.4) with ESMTP id j9IJ3P2f092803; Tue, 18 Oct 2005 13:03:25 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id j9IJ3OST092802; Tue, 18 Oct 2005 13:03:24 -0600 (MDT) (envelope-from mfuhr) Date: Tue, 18 Oct 2005 13:03:24 -0600 From: Michael Fuhr To: Rodrigo Madera Cc: pgsql-performance@postgresql.org Subject: Re: Inefficient escape codes. Message-ID: <20051018190324.GA92715@winnie.fuhr.org> References: <3cf983d0510181107sb060171je702da5fe0c29252@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3cf983d0510181107sb060171je702da5fe0c29252@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200510/267 X-Sequence-Number: 15035 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