Re: Strict Set Returning Functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Strict Set Returning Functions
Date: 2011-06-15 23:24:19
Message-ID: 9795.1308180259@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> On Wed, Jun 15, 2011 at 8:05 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
>>> So a function that is both STRICT and SET RETURNING will return rows.

>> Really? The case behaves as expected for me.

> Seems that's the wrong question. Let me return to why I raised this:

> Why does evaluate_function() specifically avoid returning NULL for a
> set returning function?

Because replacing the SRF call with a constant NULL would produce the
wrong result, ie, a single row containing NULL, not zero rows.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-06-15 23:28:53 Re: gcc 4.6 -Wunused-but-set-variable
Previous Message Simon Riggs 2011-06-15 23:02:47 Re: On-the-fly index tuple deletion vs. hot_standby