-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Hi Joseph,
I compiled PLR (Master) successfully on MacOs Mojave.
When I create the extension and try to create a function from the manual, I get the following error:
test=# create extension plr;
CREATE EXTENSION
test=# CREATE OR REPLACE FUNCTION r_max (integer, integer) RETURNS integer AS '
test'# if (arg1 > arg2)
test'# return(arg1)
test'# else
test'# return(arg2)
test'# ' LANGUAGE 'plr' STRICT;
psql: ERROR: R interpreter parse error
DETAIL: R parse error caught in "
if (arg1 > arg2)
return(arg1)
else
return(arg2)
".
test=#
But when I put the "else" directly after "return(arg1)" then everything is fine:
test=# CREATE OR REPLACE FUNCTION r_max (integer, integer) RETURNS integer AS '
test'# if (arg1 > arg2)
test'# return(arg1) else
test'# return(arg2)
test'# ' LANGUAGE 'plr' STRICT;
CREATE FUNCTION
test=#
Could it be that PLR extension has problems with line feeds?
On PostgreSQL 11 with PLR 8.4 everything works fine as expected!
James