Re: BUG #14017: strange syntax error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: anthony(at)arkia(dot)nl
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14017: strange syntax error
Date: 2016-03-12 16:03:49
Message-ID: 13687.1457798629@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

anthony(at)arkia(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Brian Ghidinelli 2016-03-12 22:06:31 Re: BUG #13970: Vacuum hangs on particular table; cannot be terminated - requires `kill -QUIT pid`
Previous Message anthony 2016-03-12 10:09:50 BUG #14017: strange syntax error