Re: Type resolution for operators

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>, Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Type resolution for operators
Date: 2000-11-08 17:08:42
Message-ID: 29677.973703322@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Thomas Lockhart writes:
>> select int '1' = '01';
>> which, btw, returns 'true'.

> Uh, how can an integer be equal to a character value? Where did the type
> system go?

Nowhere. This is the same behavior as that statement had in 7.0 (and
many versions before, I believe): given "int4-constant operator
unknown-constant", the unknown constant is preferentially resolved to
int4.

Now if you say

select int '1' = text '01';

you should and do get

ERROR: Unable to identify an operator '=' for types 'int4' and 'text'
You will have to retype this query using an explicit cast

But this change is *not* to rip out the concept of unknown-type
constants entirely, only to fall back to treating them as text
*after* all else fails.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Trewern, Ben 2000-11-08 17:14:28 V7.0.3 Released! - According to ZDNet
Previous Message Peter Eisentraut 2000-11-08 16:51:38 Re: Type resolution for operators