how to reference variables in pgbench custom scripts?

From: Lonni J Friedman <netllama(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: how to reference variables in pgbench custom scripts?
Date: 2013-06-18 21:14:49
Message-ID: CAP=oouFzknFUakVs+D=m4vjiY11uh3_qxvXR+UgFY2eYptFtYA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm attempting to write a custom pgbench script (called via the -f
option), with a variable set at the top with:
\setrandom aid 100 50875000

However, I can't quite figure out how to reference the new aid
variable. The documentation simply states that a variable is
referenced with a colon in front of its name (:aid ). However, I
can't figure out how to make this work if the variable is embedded
between other characters. For example, I want to do something like
this:

CREATE INDEX nppsmoke_tmp_:aid_idx ON nppsmoke_tmp_:aid (testname);

However, when I run pgbench, it fails:
Client 0 aborted in state 4: ERROR: syntax error at or near ":"
LINE 1: CREATE INDEX nppsmoke_tmp_:aid_idx ON nppsmoke_tmp_29954053 ...

Is there a default delimiter, such as bash's curly brackets (${aid}) ?

thanks

Browse pgsql-general by date

  From Date Subject
Next Message Steven Schlansker 2013-06-18 21:17:04 Re: Index over only uncommon values in table
Previous Message David Johnston 2013-06-18 20:49:30 Re: Index over only uncommon values in table