Re: Different cast behavior of TEXT and VARCHAR - Mailing list pgsql-general

From Tom Lane
Subject Re: Different cast behavior of TEXT and VARCHAR
Date
Msg-id 9587.1302618584@sss.pgh.pa.us
Whole thread Raw
In response to Different cast behavior of TEXT and VARCHAR  (tomas@tuxteam.de)
Responses Re: Different cast behavior of TEXT and VARCHAR
List pgsql-general
tomas@tuxteam.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

pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: PostgreSQL backend process high memory usage issue
Next
From: tomas@tuxteam.de
Date:
Subject: Re: Different cast behavior of TEXT and VARCHAR