pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: anthony@arkia.nl
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14017: strange syntax error
Date: Sat, 12 Mar 2016 11:03:49 -0500
Message-ID: <13687.1457798629@sss.pgh.pa.us> (raw)
In-Reply-To: <20160312100950.8904.56439@wrigleys.postgresql.org>
References: <20160312100950.8904.56439@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

anthony@arkia.nl writes:
> When running the create or replace function on the following I get this
> error 

> ERROR:  syntax error at or near "("
> LINE 5: ...trim(isnull(new.straat,''::text) || ' ' || isnull (  new.hui...

ISNULL is a keyword; it's a short form of IS NULL.  It's only by pure
chance that you've ever been able to use this function:

> CREATE OR REPLACE FUNCTION public."isnull"(

without double-quoting its name everywhere.  The fact that it accidentally
worked in this context before 9.5, but fails now, probably has something
to do with the changes we made in 9.5 to give IS NULL the syntactic
precedence required by the SQL standard.

You could rename the function to something that doesn't conflict, like
"is_null".  But really my recommendation is to drop it entirely and use
COALESCE(), which does the same thing, is considerably more efficient,
and is SQL-standard.

			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: <13687.1457798629@sss.pgh.pa.us>
Permalink:  ../13687.1457798629@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13687.1457798629@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, anthony@arkia.nl
  Subject: Re: BUG #14017: strange syntax error
  In-Reply-To: <13687.1457798629@sss.pgh.pa.us>
  References: <20160312100950.8904.56439@wrigleys.postgresql.org> <13687.1457798629@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