postgresql/src/backend
Tom Lane 1de468099d Disallow set-returning functions within window OVER clauses.
We previously allowed this, but it leads to odd behaviors, basically
because putting a SRF there is inconsistent with the principle that a
window function doesn't change the number of rows in the query result.
There doesn't seem to be a strong reason to try to make such cases
behave consistently.  Users should put their SRFs in lateral FROM
clauses instead.

This issue has been sitting on the back burner for multiple years
now, partially because it didn't seem wise to back-patch such a
change.  Let's squeeze it into v19 before it's too late.

Bug: #17502
Bug: #19535
Reported-by: Daniel Farkaš <daniel.farkas@datoris.com>
Reported-by: Qifan Liu <imchifan@163.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/17502-281a7aaacfaa872a@postgresql.org
Discussion: https://postgr.es/m/19535-376081d7cc07c86d@postgresql.org
Backpatch-through: 19
2026-06-30 17:21:23 -04:00
..
access Fix unlogged sequence corruption after standby promotion 2026-06-30 08:48:47 +09:00
archive Don't include wait_event.h in pgstat.h 2026-03-06 16:24:58 +01:00
backup Pre-beta mechanical code beautification, step 1: run pgindent. 2026-05-13 10:34:17 -04:00
bootstrap Rework signal handler infrastructure to pass sender info as argument. 2026-04-15 07:30:34 -04:00
catalog Readable identity strings for property graph objects 2026-06-23 09:13:11 +02:00
commands Fix unlogged sequence corruption after standby promotion 2026-06-30 08:48:47 +09:00
executor Make SPI_prepare argtypes argument const 2026-06-30 15:43:56 +02:00
foreign Remove bits* typedefs. 2026-03-30 16:12:08 -05:00
jit Update JIT tuple deforming code for virtual generated columns 2026-06-19 15:26:18 +12:00
lib Pre-beta mechanical code beautification, step 1: run pgindent. 2026-05-13 10:34:17 -04:00
libpq Fix md5_password_warnings for role and database settings 2026-06-12 08:32:39 +09:00
main Update copyright for 2026 2026-01-01 13:24:10 -05:00
nodes IS JSON/JSON(): Protect against expressions uncoercible to text 2026-06-11 16:17:58 +02:00
optimizer Move FOR PORTION OF volatile check into planner 2026-06-27 13:51:11 +02:00
parser Disallow set-returning functions within window OVER clauses. 2026-06-30 17:21:23 -04:00
partitioning Reject degenerate SPLIT PARTITION with DEFAULT partition 2026-05-25 11:57:42 +03:00
po Translation updates 2026-06-01 12:13:54 +02:00
port Use "grep -E" not "egrep". 2026-05-13 12:07:19 -04:00
postmaster Use placeholders and not GUC names in error message (autovacuum) 2026-06-30 16:16:56 +09:00
regex Harden our regex engine against integer overflow in size calculations. 2026-05-11 05:13:46 -07:00
replication Fix misreporting of publisher sequence permissions during sync 2026-06-20 18:19:23 +09:00
rewrite Fix LATERAL references in GRAPH_TABLE with multi-label pattern 2026-06-05 09:27:51 +02:00
snowball Fix meson build of snowball code. 2026-01-05 16:51:36 -05:00
statistics Simplify some stats restore code with InputFunctionCallSafe() 2026-06-30 08:30:08 +09:00
storage Change stat_lock.wait_time to double precision 2026-06-30 12:47:34 +09:00
tcop Simplify signature of ProcessStartupPacket() 2026-05-17 07:44:17 +09:00
tsearch dict_synonym.c: remove incorrect outlen. 2026-06-08 11:47:53 -07:00
utils Make SPI_prepare argtypes argument const 2026-06-30 15:43:56 +02:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile ssl: Serverside SNI support for libpq 2026-03-18 12:37:11 +01:00
meson.build Add CONCURRENTLY option to REPACK 2026-04-06 21:55:08 +02:00
nls.mk Create a separate file listing backend types 2025-09-26 15:21:49 +02:00