Re: [RFC] Add an until-0 loop in psql

Поиск
Список
Период
Сортировка
Искать
От
Pavel Stehule
Тема
Re: [RFC] Add an until-0 loop in psql
Дата
Msg-id
CAFj8pRDMdWs4dr7JKvmbsTAmhT0D1revCxyoY6QuyacYwH9MFA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
[RFC] Add an until-0 loop in psql Pierre Ducroquet <pierre.ducroquet@people-doc.com>
Re: [RFC] Add an until-0 loop in psql Corey Huinker <corey.huinker@gmail.com>
Re: [RFC] Add an until-0 loop in psql "Daniel Verite" <daniel@manitou-mail.org>
Re: [RFC] Add an until-0 loop in psql Pierre Ducroquet <pierre.ducroquet@people-doc.com>
Re: [RFC] Add an until-0 loop in psql Corey Huinker <corey.huinker@gmail.com>
Re: [RFC] Add an until-0 loop in psql Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [RFC] Add an until-0 loop in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [RFC] Add an until-0 loop in psql Corey Huinker <corey.huinker@gmail.com>
Re: [RFC] Add an until-0 loop in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [RFC] Add an until-0 loop in psql Corey Huinker <corey.huinker@gmail.com>
Re: [RFC] Add an until-0 loop in psql Pavel Stehule <pavel.stehule@gmail.com>
Re: [RFC] Add an until-0 loop in psql Pavel Stehule <pavel.stehule@gmail.com>


2018-04-28 7:36 GMT+02:00 Corey Huinker <corey.huinker@gmail.com>:



What you don't see here is that you're using your psql process's available open file handles as a stack, and when you hit that limit psql will fail. If you remove that limit, then you get a bit further before psql segfaults on you. I think I got ~2700 files deep before that happened. Your stackage may vary.

I'm not saying this is a good solution, quite the contrary. I think the sane solution is right around the corner in Version 11.

Now if we just had a way of passing parameters into DO blocks...

I hope so there will be schema (temporal) variables:

create temp variable foo int default 10;

do $$
begin
  for i in 1..foo loop
    raise notice '%', i;
  end loop;
end;
$$;

That would be nice too.

A while back, somebody explained why implementing parameters in a DO block was so hard, but I don't recall why, and the search terms "do" and "parameter" don't really narrow things down.

I did it too. It is not too hard - there was not a agreement on syntax.

can be nice some like CTE

WITH PROCEDURE x(a int, b int) AS ... $$ SELECT x(10);

Maybe Oracle supports this syntax

Pavel
 

В списке pgsql-hackers по дате отправления
От: Michael Paquier
Дата:
От: John Naylor
Дата:
FAQ