Re: pgbench \for or similar loop

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgbench \for or similar loop
Date: 2011-04-20 06:05:07
Message-ID: BANLkTinuKipXMZmvHcAxQDNbqOyVYgqnEA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

I played with psql extensions two years ago - it can do it

http://okbob.blogspot.com/2009/03/experimental-psql.html

The source code is available on pgfoundry

Regards

Pavel Stehule

2011/4/19 David Fetter <david(at)fetter(dot)org>:
> On Mon, Apr 18, 2011 at 06:02:53PM -0300, Alvaro Herrera wrote:
>> 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?
>
> Are existing mechanisms (WITH and DO) insufficient for the purpose?
>
> Cheers,
> David.
> --
> David Fetter <david(at)fetter(dot)org> http://fetter.org/
> Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
> Skype: davidfetter      XMPP: david(dot)fetter(at)gmail(dot)com
> iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics
>
> Remember to vote!
> Consider donating to Postgres: http://www.postgresql.org/about/donate
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2011-04-20 06:30:24 Re: Re: [COMMITTERS] pgsql: setlocale() on Windows doesn't work correctly if the locale name
Previous Message Greg Stark 2011-04-20 05:16:35 Re: REINDEX vs broken HOT chains, redux