Re: Problem with || and data types - Mailing list pgsql-general

From Tom Lane
Subject Re: Problem with || and data types
Date
Msg-id 25761.1051752848@sss.pgh.pa.us
Whole thread Raw
In response to Problem with || and data types  ("Peter Darley" <pdarley@kinesis-cem.com>)
Responses Re: Problem with || and data types  ("Peter Darley" <pdarley@kinesis-cem.com>)
List pgsql-general
"Peter Darley" <pdarley@kinesis-cem.com> writes:
> ... AND Import_Items.Name <>(SELECT QT.Import_As FROM
> Question_Types QT, Border_Type_Translation BTT WHERE QT.Value=BTT.First_Type
> AND BTT.Second_Type=Border_Questions.Type) || ':' ||
> Border_Questions.Field_Name

Actually, the first operator you have there is "<>" not "=".  "<>" is
considered a generic Op, just like "||", so the binding will be left-to-
right.  AFAIK this was the same in 7.2 and for a good ways before.

In short, you need some parentheses.

            regards, tom lane


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Problem with || and data types
Next
From: Jean-Michel POURE
Date:
Subject: Join Stallman and Software SMEs to refuse sofware patents