pgbench \for or similar loop

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: pgbench \for or similar loop
Date: 2011-04-18 21:02:53
Message-ID: 1303159471-sup-2303@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Today (and previously) I wished that pgbench had a mechanism to help
create simple random databases. For example, I could create a table
"tenk" and fill it with random stuff like

\setrandom foo 1 10000
insert into foo values (:foo)

Now I have to run this 10000 times or something like that. But I don't
want a transaction for each of those, so I had a desire for something
like this:

begin;
\for iterator 1 10000
\setrandom foo 1 :iterator
insert into foo values (:foo);
\end
commit;

Would something like this be acceptable?

--
Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2011-04-18 21:16:52 Re: ORDER BY 1 COLLATE
Previous Message Dann Corbit 2011-04-18 20:45:59 Re: ORDER BY 1 COLLATE