Remove unnecessary check on set-returning functions in values_lists

From: Andrei Lepikhov <lepihov(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Remove unnecessary check on set-returning functions in values_lists
Date: 2024-08-28 14:26:22
Message-ID: ad1690d1-1e72-4704-8516-53830c1533d4@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I would like to understand the pull_up_simple_values code a little bit more.
Pull-up of simple values was implemented in 2015 by commit f4abd02. In
the is_simple_values I see a check on the expression_returns_set() of
the RTE values list.

But since d43a619 in 2017 the check_srf_call_placement has reported an
ERROR in the case of set-returning function inside a VALUES expression.
Let's demonstrate:

SELECT * FROM (VALUES ((generate_series(1,1E2))));
ERROR: set-returning functions are not allowed in VALUES
LINE 1: SELECT * FROM (VALUES ((generate_series(1,1E2))));

I think, the expression_returns_set examination doesn't necessary and we
can replace it with an assertion, if needed (see attachment).
Am I wrong?

--
regards, Andrei Lepikhov

Attachment Content-Type Size
0001-Remove-unnecessary-check-on-set-returning-functions-.patch text/plain 1.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-08-28 14:57:38 Re: allowing extensions to control planner behavior
Previous Message Sushrut Shivaswamy 2024-08-28 14:21:22 Reading all tuples in Index Access Method