Re: plpgsql variable named as SQL keyword

2019-02-28 Thread Pavel Stehule
čt 28. 2. 2019 v 19:20 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > Maybe we should to disallow variables named as sql reserved keyword. > > That would just break existing code. There are lots of other > examples where you can get away with such things. > > We've expended quite a

Re: plpgsql variable named as SQL keyword

2019-02-28 Thread Tom Lane
Pavel Stehule writes: > Maybe we should to disallow variables named as sql reserved keyword. That would just break existing code. There are lots of other examples where you can get away with such things. We've expended quite a lot of sweat to avoid reserving more names than we had to in

plpgsql variable named as SQL keyword

2019-02-28 Thread Pavel Stehule
Hi one user of plpgsql_check reported interesting error message create or replace function omega.foo(a int) returns int as $$ declare offset integer := 0; begin return offset + 1; end; $$ language plpgsql; postgres=# select omega.foo(10); ERROR: query "SELECT offset + 1" returned 0 columns