testing nested case-when scoping - Mailing list pgsql-hackers

From Pavel Stehule
Subject testing nested case-when scoping
Date
Msg-id BANLkTikJt3wab9XSisT-NUBh1jeC3q=yiQ@mail.gmail.com
Whole thread Raw
Responses Re: testing nested case-when scoping
List pgsql-hackers
Hello Heikki,

probably I found a bug in patch:

CREATE FUNCTION fx(i integer) RETURNS integer   LANGUAGE plpgsql   AS $$begin raise notice '>>%<<', i; return i;
end;$$;

CREATE FUNCTION fx1(integer) RETURNS text   LANGUAGE sql   AS $_$ select case $1 when 1 then 'A' else 'B' end$_$;

CREATE FUNCTION fx2(text) RETURNS text   LANGUAGE sql   AS $_$ select case $1 when 'A' then 'a' else 'b' end$_$;

CREATE TABLE foo (   a integer
);

COPY foo (a) FROM stdin;
1
0
\.

postgres=# select fx2(fx1(fx(a))) from foo;
NOTICE:  >>1<<
ERROR:  invalid expression parameter reference (1 levels up, while
stack is only 1 elements deep)

Regards

Pavel


pgsql-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: [BUG] SSPI authentication fails on Windows when server parameter is localhost or domain name
Next
From: Bruce Momjian
Date:
Subject: Re: pg_upgrade using appname to lock out other users