Re: Fetch zero result rows when executing a query? - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Fetch zero result rows when executing a query?
Date
Msg-id CA+TgmoayJp8SfE8y968-v-ckeGxT+Srng9AUk+rUnyOrOnGopg@mail.gmail.com
Whole thread Raw
In response to Re: Fetch zero result rows when executing a query?  (Shay Rojansky <roji@roji.org>)
Responses Re: Fetch zero result rows when executing a query?  (Shay Rojansky <roji@roji.org>)
List pgsql-hackers
On Sun, Feb 8, 2015 at 3:56 AM, Shay Rojansky <roji@roji.org> wrote:
> Just to be precise: what is strange to me is that the max_rows feature
> exists
> but has no 0 value. You and Marko are arguing that the whole feature should
> be
> deprecated (i.e. always return all rows).

I think the fact that it has no zero value is probably just a
historical accident; most likely, whoever designed it originally
(probably twenty years ago) didn't think about queries with
side-effects and therefore didn't consider that wanting 0 rows would
ever be sensible.  Meanwhile, a sentinel value was needed to request
all rows, so they used 0.  If they'd thought of it, they might have
picked -1 and we'd not be having this discussion.

FWIW, I'm in complete agreement that it would be good if we had this
feature.  I believe this is not the first report we've had of
PostgreSQL doing things in ways that mesh nicely with standardized
driver interfaces.  Whether we think those interfaces are
well-designed or not, they are standardized.  When people use $OTHERDB
and have a really great driver, and then they move to PostgreSQL and
get one with more warts, it does not encourage them to stick with
PostgreSQL.

.NET is not some fringe user community that we can dismiss as
irrelevant.  We need users of all languages to want to use PostgreSQL,
not just users of languages any one of us happens to personally like.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Parallel Seq Scan
Next
From: Andres Freund
Date:
Subject: Re: Parallel Seq Scan