Re: Suggestions for implementing IS DISTINCT FROM?
От | Tom Lane |
---|---|
Тема | Re: Suggestions for implementing IS DISTINCT FROM? |
Дата | |
Msg-id | 8708.1024848099@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Suggestions for implementing IS DISTINCT FROM? (Thomas Lockhart <lockhart@fourpalms.org>) |
Список | pgsql-hackers |
Thomas Lockhart <lockhart@fourpalms.org> writes: > I'm looking at implementing IS DISTINCT FROM, among other things. > ... > I was thinking to implement this by simply expanding these rules within > gram.y to be a tree of comparison tests. Please, please, do not do that. Make a new expression node tree type, instead. We've made this mistake before (eg for BETWEEN) and I don't want to do it again. Aside from the points you make, a direct expansion approach cannot reverse-list properly in rules/views, and it will force multiple evaluations of arguments that should not be multiply evaluated. Adding a new expression node tree type is not too difficult these days; see for example Joe Conway's recent NullTest and BooleanTest additions. I believe the existing expansions of row comparison operators (makeRowExpr) should be replaced by specialized nodes, too. That would give us a shot at implementing row '<', '>' comparisons in a spec-compliant fashion... regards, tom lane
В списке pgsql-hackers по дате отправления: