Vallimaharajan G <vallimaharajan...@zohocorp.com> writes: > I am currently referring to the Postgres source code (psql (PostgreSQL) 14.3) > and came across a particular section related to window aggregate > initialization that has left me with a question. Specifically, I noticed a > conditional case in the initialization of per aggregate > (initialize_peraggregate in nodeWindowAgg.c) where the winstate frameOptions > is being checked, but it appears that frameOptions is not set before this > conditional case.
You are right, and that's a bug. It's not of major consequence --- it would just cause us to set up for moving-aggregate mode when we won't ever actually move the frame head -- but it's at least a little bit inefficient. While I'm looking at it, there's a pretty obvious typo in the adjacent comment: - * and collect the right set of fields from the pg_attribute entry. + * and collect the right set of fields from the pg_aggregate entry. regards, tom lane