OSDN Git Service

Revert patch to coerce 'unknown' type parameters in the backend. As Tom
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 19 Aug 2010 16:54:48 +0000 (16:54 +0000)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 19 Aug 2010 16:54:48 +0000 (16:54 +0000)
commitcc46c4e862214217e5901c2ea4573840a15dc2f4
tree5646768d83c30a2e45f5af18cf0ca9bddd2b32f4
parent67b4fcf80689da2bc89fcacea7bb80c871fa3429
Revert patch to coerce 'unknown' type parameters in the backend. As Tom
pointed out, it would need a 2nd pass after the whole query is processed to
correctly check that an unknown Param is coerced to the same target type
everywhere. Adding the 2nd pass would add a lot more code, which doesn't
seem worth the risk given that there isn't much of a use case for passing
unknown Params in the first place. The code would work without that check,
but it might be confusing and the behavior would be different from the
varparams case.

Instead, just coerce all unknown params in a PL/pgSQL USING clause to text.
That's simple, and is usually what users expect.

Revert the patch in CVS HEAD and master, and backpatch the new solution to
8.4. Unlike the previous solution, this applies easily to 8.4 too.
src/backend/parser/parse_param.c
src/pl/plpgsql/src/pl_exec.c