Re: Odd results in SELECT - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Odd results in SELECT
Date
Msg-id 4265.989589194@sss.pgh.pa.us
Whole thread Raw
In response to Re: Odd results in SELECT  (Kovacs Zoltan <kovacsz@pc10.radnoti-szeged.sulinet.hu>)
List pgsql-hackers
See my prior reply to Philip: the problem is that the given string is
longer than NAMEDATALEN.  When you writerulename = 'foo'
(rulename is of type NAME) the untyped literal string 'foo' gets coerced
to NAME, ie truncated to fit, and all is well.  When you writerulename = ('foo' || 'bar')
the result of the || operator is type TEXT, so instead rulename is
converted to TEXT and a text comparison is performed.  In this case the
righthand value is not truncated and so the match will always fail.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Yaacov Akiba Slama
Date:
Subject: Re: New Linux xfs/reiser file systems
Next
From: Tom Lane
Date:
Subject: Re: Converting PL/SQL to PL/PGSQL