how to reference variables in pgbench custom scripts?

Поиск
Список
Период
Сортировка
От Lonni J Friedman
Тема how to reference variables in pgbench custom scripts?
Дата
Msg-id CAP=oouFzknFUakVs+D=m4vjiY11uh3_qxvXR+UgFY2eYptFtYA@mail.gmail.com
обсуждение исходный текст
Список 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


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

Предыдущее
От: David Johnston
Дата:
Сообщение: Re: Index over only uncommon values in table
Следующее
От: Steven Schlansker
Дата:
Сообщение: Re: Index over only uncommon values in table