Variable referencing itself in example of pgbench.sgml

Started by Michael Paquierabout 11 years ago2 messageshackers
Jump to latest
#1Michael Paquier
michael@paquier.xyz

Hi all,

While looking at some recent commit related to pgbench I noticed this
example in the docs:
\set aid (1021 * :aid) % (100000 * :scale) + 1
This actually would fail because aid references itself.

Attached is a patch to change this example as follows:
-\set aid (1021 * :aid) % (100000 * :scale) + 1
+\set aid (1021 * :ntellers) % (100000 * :scale) + 1
Regards,
-- 
Michael

Attachments:

20150319_pgbench_docfix.patchtext/x-diff; charset=US-ASCII; name=20150319_pgbench_docfix.patchDownload+1-1
#2Robert Haas
robertmhaas@gmail.com
In reply to: Michael Paquier (#1)
Re: Variable referencing itself in example of pgbench.sgml

On Thu, Mar 19, 2015 at 7:20 AM, Michael Paquier
<michael.paquier@gmail.com> wrote:

While looking at some recent commit related to pgbench I noticed this
example in the docs:
\set aid (1021 * :aid) % (100000 * :scale) + 1
This actually would fail because aid references itself.

There's no special prohibition against that. It works fine if aid is
already set.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers