Re: Fetch zero result rows when executing a query?

From: Shay Rojansky <roji(at)roji(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
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-11 00:05:53
Message-ID: CADT4RqDcBNxSV_H_gYRPMbavzx8fRO3FW3AVo6YgOCYywGJ3-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks for understanding Robert, that's more or less what I had in mind, I
was mainly wondering if I were missing some deeper explanation for the
absence of the possibility of requesting 0 rows.

Regardless of all of the above, it's really no big deal. I'll go ahead and
use max_rows=1 for now, hopefully you guys don't decide to deprecate it.

Shay

On Tue, Feb 10, 2015 at 3:00 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> 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 Tatsuo Ishii 2015-02-11 00:07:40 Re: Typo in logicaldecoding.sgml
Previous Message Andres Freund 2015-02-10 23:57:59 Re: Typo in logicaldecoding.sgml