From: Tom Lane <tgl@sss.pgh.pa.us>
To: raf@raf.org
Cc: pgsql-general@postgresql.org
Subject: Re: Inconsistent compilation error
Date: Wed, 18 Apr 2018 22:06:20 -0400
Message-ID: <2628.1524103580@sss.pgh.pa.us> (raw)
In-Reply-To: <20180419010228.jcogqkeu2b7bxh2q@raf.org>
References: <20180419010228.jcogqkeu2b7bxh2q@raf.org>
raf@raf.org writes:
> I have a stored function with code that looks like:
> raise notice '% %', 'blah_history.original_id', r;
> But I'm getting this compilation error when it tries to load this
> function:
> ERROR: too many parameters specified for RAISE
That is ... weird. The code is checking that the number of % symbols in
the string literal matches the number of comma-separated expressions after
the literal, and it sure looks like those match.
> Which looks fine. The really wierd thing is that this happens when done on a
> debian9 host but when I load the function from another host (my macos laptop)
> with the same function into the same database, it works fine.
Weirder yet.
The only idea that comes to mind is that '%%', with nothing between the
percent signs, means a literal '%' character not two parameter markers.
If the contents of the string literal were '%%' then this is exactly
the error message you'd get.
So here's a long-shot theory: what's in your source code is not a plain
space but something weird like a no-break space, and when you transfer
that text from machine A to machine B, the no-break space is getting
dropped.
regards, tom lane
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-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, raf@raf.org
Subject: Re: Inconsistent compilation error
In-Reply-To: <2628.1524103580@sss.pgh.pa.us>
References: <20180419010228.jcogqkeu2b7bxh2q@raf.org> <2628.1524103580@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