Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options
Tatsuo Ishii <ishii@sraoss.co.jp>
From: Tatsuo Ishii <ishii@sraoss.co.jp>
To: ojford@gmail.com
Cc: ishii@sraoss.co.jp, pgsql-hackers@postgresql.org, tgl@sss.pgh.pa.us,
vik@postgresfriends.org, andrew@tao11.riddles.org.uk, david@fetter.org,
krasiyan@gmail.com
Date: 2023-05-06T09:35:34Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix coding style with "else".
- 20628b62e46e 19 (unreleased) landed
-
Fix multi WinGetFuncArgInFrame/Partition calls with IGNORE NULLS.
- 2d7b247cb414 19 (unreleased) landed
-
Fix Coverity issue reported in commit 2273fa32bce.
- dd766a441d69 19 (unreleased) landed
-
Use ereport rather than elog in WinCheckAndInitializeNullTreatment.
- 5f3808646f67 19 (unreleased) landed
-
Avoid uninitialized-variable warnings from older compilers.
- 71540dcdcb22 19 (unreleased) cited
-
Fix Coverity issues reported in commit 25a30bbd423.
- 2273fa32bce7 19 (unreleased) landed
-
Improve EXPLAIN's display of window functions.
- 8b1b342544b6 18.0 cited
-
Automatically generate node support functions
- 964d01ae90c3 16.0 cited
> The last time this was discussed ( > https://www.postgresql.org/message-id/1037735.1610402426%40sss.pgh.pa.us) > it was suggested to make the feature generalizable, beyond what the > standard says it should be limited to. I have read the mail. In my understanding nobody said that standard window functions should all accept the null treatment clause. Also Tom said: https://www.postgresql.org/message-id/5567.1537884439%40sss.pgh.pa.us > The questions of how we interface to the individual window functions > are really independent of how we handle the parsing problem. My > first inclination is to just pass the flags down to the window functions > (store them in WindowObject and provide some additional inquiry functions > in windowapi.h) and let them deal with it. As I said before I totally agree with this. With my patch if a (custom) window function does not want to accept null treatment clause, it just calls ErrorOutNullTreatment(). It will raise an error if IGNORE NULLS or RESPECT NULLS is provided. If it does call the function, it is up to the function how to deal with the null treatment. In another word, the infrastructure does not have fixed rules to allow/disallow null treatment clause for each window function. It's "delegated" to each window function. Anyway we can change the rule for other than nth_value etc. later easily once my patch is brought in. > With it generalizable, there would need to be extra checks for custom > functions, such as if they allow multiple column arguments (which I'll add > in v2 of the patch if the design's accepted). I am not sure if allowing-multiple-column-arguments patch should be provided with null-treatment patch. > So I think we need a consensus on whether to stick to limiting it to > several specific functions, or making it generalized yet agreeing the rules > to limit it (such as no agg functions, and no functions with multiple > column arguments). Let's see the discussion... Best reagards, -- Tatsuo Ishii SRA OSS LLC English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp