Move FOR PORTION OF volatile check into planner

Peter Eisentraut <peter@eisentraut.org>

Commit: a272a58b94249879c3f7e170a5ebfaeec940d411
Author: Peter Eisentraut <peter@eisentraut.org>
Date: 2026-06-27T11:51:11Z
Move FOR PORTION OF volatile check into planner

This needs to be wary of the function volatility changing after we
check it.  We cannot enforce this when checking at parse time, so move
it later, into the planner.

Author: Paul A. Jungwirth <pj@illuminatedcomputing.com>
Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: jian he <jian.universality@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/CA%2BrenyUte0_UJsJiDJQi82oaBsMJn%3Dcct0Wn%3DvOqXtuDn%3DYYJA%40mail.gmail.com

Files

PathChange+/−
src/backend/optimizer/plan/planner.c modified +12 −0
src/backend/parser/analyze.c modified +0 −3

Discussion