Re: Row pattern recognition
| От | Tatsuo Ishii |
|---|---|
| Тема | Re: Row pattern recognition |
| Дата | |
| Msg-id | 20260213.204650.823915400821412238.ishii@postgresql.org обсуждение |
| Ответ на | Re: Row pattern recognition (Tatsuo Ishii <ishii@postgresql.org>) |
| Ответы |
Re: Row pattern recognition
|
| Список | pgsql-hackers |
> Hi Henson, > > In my understanding RANGE/GROUPS are not allowed when RPR is defined. > (See ISO/IEC 19075-5 section 6.10.2 "ROWS BETWEEN CURRENT ROW AND"). > So proper fix would be to error out at the parse/analyze phase if > RANGE/GROUPS are used when RPR is defined. Attached is a patch to disallow RANGE/GROUPS when RPR is used. On top of your last patches. Best regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp diff --git a/src/backend/parser/parse_rpr.c b/src/backend/parser/parse_rpr.c index 048e84bd7bd..cc693b36208 100644 --- a/src/backend/parser/parse_rpr.c +++ b/src/backend/parser/parse_rpr.c @@ -68,6 +68,25 @@ transformRPR(ParseState *pstate, WindowClause *wc, WindowDef *windef, return; /* Check Frame options */ + + /* Frame type must be "ROW" */ + if (wc->frameOptions & FRAMEOPTION_GROUPS) + ereport(ERROR, + (errcode(ERRCODE_SYNTAX_ERROR), + errmsg("FRAME option GROUP is not permitted when row pattern recognition is used"), + errhint("Use: ROWS insted"), + parser_errposition(pstate, + windef->frameLocation >= 0 ? + windef->frameLocation : windef->location))); + if (wc->frameOptions & FRAMEOPTION_RANGE) + ereport(ERROR, + (errcode(ERRCODE_SYNTAX_ERROR), + errmsg("FRAME option RANGE is not permitted when row pattern recognition is used"), + errhint("Use: ROWS insted"), + parser_errposition(pstate, + windef->frameLocation >= 0 ? + windef->frameLocation : windef->location))); + /* Frame must start at current row */ if ((wc->frameOptions & FRAMEOPTION_START_CURRENT_ROW) == 0) {
В списке pgsql-hackers по дате отправления: