Re: pgbench \for or similar loop

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: pgbench \for or similar loop
Дата
Msg-id 1303162423-sup-5894@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: pgbench \for or similar loop  (Merlin Moncure <mmoncure@gmail.com>)
Ответы Re: pgbench \for or similar loop  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Excerpts from Merlin Moncure's message of lun abr 18 18:26:54 -0300 2011:
> On Mon, Apr 18, 2011 at 4:02 PM, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:

> > begin;
> > \for iterator 1 10000
> >  \setrandom foo 1 :iterator
> >  insert into foo values (:foo);
> > \end
> > commit;
> >
> > Would something like this be acceptable?
> 
> *) what does this do that isn't already possible with 'DO' (not being
> snarky, genuinely curious)?

Uhm, not sure.  I'm not really used to having DO available so I didn't
think about it.  I'll look at it a bit more.

> *) should psql get some of these features?  simple logic and looping
> would be a nice addition?

I dunno.  They have been proposed and shot down in the past.  Apparently
people don't want psql to become too powerful.  ("But that would make
psql turing complete! Soon you're going to want to have \while on it!").
I think pgbench is supposed to be designed to handle data in bulk which
is why I started using it for this in the first place.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


В списке pgsql-hackers по дате отправления:

Предыдущее
От: David Fetter
Дата:
Сообщение: HTML tags :/
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: HTML tags :/