Please find attached a patch for pgbench that introduces a new auto-variable 'client_number'. Following in the footsteps of 'scale' auto-variable, this is not declared if the user has specified this variable using -D switch.
Since 'clientid' is a very common name a user can use for their own script's variable, I chose to call this auto-variable client_number; just to avoid conflicts. This variable can come in handy when you want to use a different expression in a query depending on which client is executing it. An example custom transaction is attached, where the UPDATE statement from any given client always updates the same logical row. Best regards, -- Gurjeet Singh http://gurjeet.singh.im/ EnterpriseDB Inc.
pgbench_add_cleint_number_variable.patch
Description: Binary data
test_update.sql
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers