Re: [patch] libpq one-row-at-a-time API - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: [patch] libpq one-row-at-a-time API
Date
Msg-id CAHyXU0zvDvj_5JJjodNMRWxao6muTmpFwW_O5Df+nFwQAZBLWg@mail.gmail.com
Whole thread Raw
In response to Re: [patch] libpq one-row-at-a-time API  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Jul 24, 2012 at 10:49 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Merlin Moncure <mmoncure@gmail.com> writes:
>> I'm arguing that *all* data getting must continue to do so through the
>> result object, and bypassing the result to get at data is breaking the
>> result abstraction in the libpq api.
>
> That's a fair point, but the single-row mode without PQgetRowData still
> fits that model, doesn't it?  From the point of view of libpqtypes it
> just looks like you got a lot of one-row query results.

Sure: Marko's exec_query_single_row example looks like 100% reasonable
libpq code.  That said, I'd still spend a few cycles to think this
through and make sure we aren't walling ourselves off from 'copy free'
behavior, even if that's reserved for a future improvement.  In
particular, I'd like to explore if PQsetSingleRowMode() should be
returning a result.

merlin


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [patch] libpq one-row-at-a-time API
Next
From: Marko Kreen
Date:
Subject: Re: [patch] libpq one-row-at-a-time API