Re: To Tom Lane 2017-09-11 <20170911083136.stdnc4w52wk3o4se@msg.df7cb.de>
> postgres=# select test_param_where();
> FEHLER: XX000: unrecognized node type: 217
> KONTEXT: SQL-Anweisung »select b from numbers where a=x«
> PL/pgSQL-Funktion test_param_where() Zeile 6 bei SQL-Anweisung
> ORT: ExecInitExprRec, execExpr.c:2031
The problem happens on the 6th iteration of this loop:
CREATE FOREIGN TABLE numbers(a int, b varchar(255)) SERVER mysql_svr OPTIONS (dbname 'testdb', table_name 'numbers');
create or replace function test_param_where() returns void as $$
DECLARE n varchar;
BEGIN FOR x IN 1..9 LOOP select b into n from numbers where a=x; raise notice 'Found number %', n; end loop;
return;
END
$$ LANGUAGE plpgsql;
SELECT test_param_where();
***************
*** 345,368 **** NOTICE: Found number Three NOTICE: Found number Four NOTICE: Found number Five
! NOTICE: Found number Six
! NOTICE: Found number Seven
! NOTICE: Found number Eight
! NOTICE: Found number Nine
! test_param_where
! ------------------
!
! (1 row)
! DELETE FROM employee;
...
--- 344,365 ---- NOTICE: Found number Three NOTICE: Found number Four NOTICE: Found number Five
! ERROR: unrecognized node type: 217
! CONTEXT: SQL statement "select b from numbers where a=x"
! PL/pgSQL function test_param_where() line 6 at SQL statement
! /* DELETE FROM employee;
...
Christoph
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers