Alvaro Herrera:
Perhaps the solution to all this is to avoid having the variables be
implicitly present in the range table of all queries. Instead, if you
need a variable's value, then you need to add the variable to the FROM
clause;
+1
This should make it easier to work with composite type schema variables
in some cases. It could also enable schema qualifying of schema
variables, or at least make it easier to do, I think.
In this case variables would share the same namespace as tables and
views, right? So I could not create a variable with the same name as
another table. Which is a good thing, I guess. Not sure how it's
currently implemented in the patch.
Best,
Wolfgang