From: anthony@arkia.nl
To: pgsql-bugs@postgresql.org
Subject: BUG #14017: strange syntax error
Date: Sat, 12 Mar 2016 10:09:50 +0000
Message-ID: <20160312100950.8904.56439@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 14017
Logged by: Anthony van den Berg
Email address: anthony@arkia.nl
PostgreSQL version: 9.5.1
Operating system: linux both fedra and ubuntu
Description:
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...
in postgresql 9.4.5 it gives no problem
I have no idea why this happens ans the first isnull call is exactly the
same als the second
CREATE OR REPLACE FUNCTION relaties.update_insert_adressen()
RETURNS trigger AS
$BODY$
BEGIN
new.adres = trim(isnull(new.straat,''::text) || ' ' || isnull (
new.huisnummer,''::text));
return new;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION relaties.update_insert_adressen()
OWNER TO postgres;
the isnull function looks like this.
CREATE OR REPLACE FUNCTION public."isnull"(
text,
text)
RETURNS text AS
$BODY$SELECT (CASE (SELECT $1
is null) WHEN true THEN $2 ELSE $1 END) AS RESULT$BODY$
LANGUAGE sql VOLATILE
COST 100;
ALTER FUNCTION public."isnull"(text, text)
OWNER TO postgres;
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: anthony@arkia.nl
Subject: Re: BUG #14017: strange syntax error
In-Reply-To: <20160312100950.8904.56439@wrigleys.postgresql.org>
References: <20160312100950.8904.56439@wrigleys.postgresql.org>
* 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