tomas(at)tuxteam(dot)de writes:
> When PREPARing statements, the type guessing machinery seems to behave
> differently for VARCHAR and TEXT. Is this intentional?
Your example works for me, in all branches back to 8.2:
regression=# create table foo(a text, b varchar);
CREATE TABLE
regression=# PREPARE s1 AS SELECT a, b FROM foo WHERE a = $1;
PREPARE
regression=# PREPARE s2 AS SELECT a, b FROM foo WHERE b = $1;
PREPARE
I wonder if you have some nondefault operators installed that are making
the query ambiguous.
regards, tom lane