On 12/11/20 12:21, Tom Lane wrote: > solution I adopted was just to invent a new CoercionContext value > COERCION_PLPGSQL, representing "use pl/pgsql's rules". (Basically > what that means nowadays is to apply CoerceViaIO if assignment cast > lookup doesn't find a cast pathway.)
That seems like a rule that might be of use in other PLs or extensions; could it have a more generic name, COERCION_FALLBACK or something? > is now quoted, but the "SET n:" bit in front of it might confuse people, > especially if we don't document this new syntax (which I'm inclined not > to, since it's useless in straight SQL). If it's true that the only choices for n: are 1: or 2:, maybe it would look less confusing in an error message to, hmm, decree that this specialized SET form /always/ takes a two-component name, but accept something special like ROUTINE.x (or UNNAMED.x or NULL.x or something) for the case where there isn't a qualifying label in the plpgsql source? It's still a strange arbitrary creation, but might give more of a hint of its meaning if it crops up in an error message somewhere. Regards, -Chap