Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] libpq patch for binding tuples in a result set to user allocated memory

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joel Reed <jreed(at)support(dot)ddiworld(dot)com>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] libpq patch for binding tuples in a result set to user allocated memory
Date: 2000-02-14 15:57:03
Message-ID: 18990.950543823@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-interfaces
Joel Reed <jreed(at)support(dot)ddiworld(dot)com> writes:
> Having been used to being able to bind tuple data from a result set to
> user allocated memory (rather than having to copy the data out of the
> "libpq" like API's buffers to my memory locations) in my days working
> with ODBC, Oracle & SQLServer's C-API, i created the following patch
> which i thought i'd submit. I've included a README as well. 

I do not like this idea very much --- in the first place, it ties the
application far too tightly to internal representational details that
should be private to libpq, and in the second place the implementation
you offer is full of little gotchas like

>   a). construct an array of PGresAttValue's whose size is equal to the
>       number of columns in the result set. if you don't you'll core dump!

I really doubt that avoiding PQgetvalue() calls is worth taking those
kinds of risks and narrowing our options for future reimplementation of
the library and protocol.

In the long run we'll probably be moving to some more-modern interface
design like CORBA, which should help to address performance concerns
like these.

			regards, tom lane

In response to

Responses

pgsql-interfaces by date

Next:From: Joel ReedDate: 2000-02-14 16:05:32
Subject: Re: [INTERFACES] libpq patch for binding tuples in a result set to user allocated memory
Previous:From: Elmar.HanekeDate: 2000-02-14 15:26:50
Subject: OLE-DB for PostgreSQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group