WHERE CURRENT OF $n still needed?
WHERE CURRENT OF $n still needed?
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
There is some code in the core parser to support the syntaxUPDATE/DELETE ... WHERE CURRENT OF $n where $n is a parameter symbol. This was put in to support plpgsql, with the expectation that $n would refer to a plpgsql cursor variable. Now that plpgsql is not doing textual insertion of $n symbols, this is dead code --- and in fact I just realized that the case is actually broken :-(. There is a regression test for WHERE CURRENT OF in plpgsql, but it is only working accidentally because the cursor's portal name is the same as its plpgsql name. What we need is for the core parser to see if the name can be resolved as a parameter, instead. While I'm fixing that, I wonder whether we should take out the $n syntax case? It's undocumented, but that doesn't mean that someone hasn't found a way to use it. Comments? regards, tom lane