Re: Fetch zero result rows when executing a query?

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Shay Rojansky <roji(at)roji(dot)org>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Subject: Re: Fetch zero result rows when executing a query?
Date: 2015-02-10 14:00:38
Message-ID: CA+TgmoayJp8SfE8y968-v-ckeGxT+Srng9AUk+rUnyOrOnGopg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Feb 8, 2015 at 3:56 AM, Shay Rojansky <roji(at)roji(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-02-10 14:08:38 Re: Parallel Seq Scan
Previous Message Robert Haas 2015-02-10 13:52:09 Re: Parallel Seq Scan