Re: Inconsistent compilation error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: raf(at)raf(dot)org
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Inconsistent compilation error
Date: 2018-04-19 02:06:20
Message-ID: 2628.1524103580@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2018-04-19 02:21:58 Re: Inconsistent compilation error
Previous Message Melvin Davidson 2018-04-19 02:04:11 Re: Inconsistent compilation error