pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: hein@bitechsystems.co.za
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13909: String concat error with CITEXT after 9.5.0 upgrade.
Date: Thu, 04 Feb 2016 12:54:56 -0500
Message-ID: <22439.1454608496@sss.pgh.pa.us> (raw)
In-Reply-To: <20160203151723.2768.51719@wrigleys.postgresql.org>
References: <20160203151723.2768.51719@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

hein@bitechsystems.co.za writes:
> m_text = 'test' || isnull(m_text,'');  --code breaks here!

ISNULL is a keyword, which I can't really recommend using as a function
name.  This example used to accidentally fail to fail before 9.5 because
ISNULL was considered to bind tighter than ||.  But now it binds less
tightly, meaning that the first part of the expression is parsed as
(('test' ||) IS NULL), which is not what you meant.

You could fix this with more parentheses:

m_text = 'test' || (isnull(m_text,''));

or by double-quoting the function name so it doesn't look like a keyword:

m_text = 'test' || "isnull"(m_text,'');

but you might be better advised to rename the function.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (2+ messages)

Message-ID: <22439.1454608496@sss.pgh.pa.us>
Permalink:  ../22439.1454608496@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22439.1454608496@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, hein@bitechsystems.co.za
  Subject: Re: BUG #13909: String concat error with CITEXT after 9.5.0 upgrade.
  In-Reply-To: <22439.1454608496@sss.pgh.pa.us>
  References: <20160203151723.2768.51719@wrigleys.postgresql.org> <22439.1454608496@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox