Re: PL/pgSQL loops?
От | Tom Lane |
---|---|
Тема | Re: PL/pgSQL loops? |
Дата | |
Msg-id | 19090.1007053375@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: PL/pgSQL loops? (Stephan Szabo <sszabo@megazone23.bigpanda.com>) |
Ответы |
Re: PL/pgSQL loops?
|
Список | pgsql-sql |
Stephan Szabo <sszabo@megazone23.bigpanda.com> writes: > In addition, this seems to work: > for intvar in 1 .. (select max(a) from a) LOOP > and this doesn't: > for intvar in 1 .. (select max(loop) from a) LOOP > and this does: > for intvar in (select max(loop) from a) .. 1 LOOP > I'm guessing that plpgsql doesn't want to try to determine if > an expression is valid and so just concats stuff to pass off, Correct ... > but that seems to mean that you need to double quote loop in > the second (which is somewhat unobvious). I would've expected it to count nested parentheses, at least. A quick look makes it appear that some places in plpgsql's gram.y do, and some don't. Ugh. regards, tom lane
В списке pgsql-sql по дате отправления: