po 6. 2. 2023 v 19:02 odesílatel David G. Johnston <david.g.johnston@xxxxxxxxx> napsal:
On Monday, February 6, 2023, Torsten Förtsch <tfoertsch123@xxxxxxxxx> wrote:After reading this I am wondering if the current behavior is actually a bug.Arguably it is a bug, and a known one at that if you want some light reading, but regardless there is presently no proposal to get rid of the POLA violation and little chance for any solution to be back-patched since the issue is lack of good existing technical options.
This is an interesting issue. I fully agree, so it is very pretty unintuitive, but when you start calculating with possibility of _expression_ indexes, it is probably the best that is possible. I don't think it is a bug. Unfortunately, at this moment we have no information about single or double braces usage. So there is not any possibility to say so there should not be an _expression_'s index. And if there can be a functional index, then using a possible variable can be really confusing without unique meaning.
This is probably only one case, where you can specify an index in a query, so there are not any other similar cases, and this special case should be documented and explained in plpgsql doc.
Regards
Pavel
David J.