Re: Libpq question - Mailing list pgsql-general

From Tom Lane
Subject Re: Libpq question
Date
Msg-id 14935.1337609391@sss.pgh.pa.us
Whole thread Raw
In response to Re: Libpq question  (Jasen Betts <jasen@xnet.co.nz>)
List pgsql-general
Jasen Betts <jasen@xnet.co.nz> writes:
> On 2012-05-16, John Townsend <jtownsend@advancedformulas.com> wrote:
>> *** So...the question: Is there a good reason why you might want to NOT
>> use libpq.dll, and just directly access the server through direct
>> function calls? ***

> libpq binds you to using NUL terminated C strings, and, no doubt, other C
> idioms.

Note that bypassing libpq will not get you around that one, because the
server (and indeed the wire protocol) also use nul-terminated strings.

Generally the places where people have chosen to reimplement the
protocol from scratch are where they *couldn't* use libpq for some
reason or other; for instance the JDBC driver doesn't use libpq because
non-Java code is painful to deal with in a Java environment.  I'm pretty
doubtful that it's worth anybody's trouble to reimplement just to save a
layer of function calls.

            regards, tom lane

pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: Global Named Prepared Statements
Next
From: Luca Ferrari
Date:
Subject: help understanding the bitmap heap scan costs