Given that the number of variables of a pgbench script is expected to be pretty small, I'm not sure that the sorting stuff is worth the effort.
I think it is a good insurance if there're many variables..
My suggestion is really to look at both implementations and to answer the question "should pgbench share its variable implementation with psql?". If the answer is yes, then the relevant part of the implementation should be moved to fe_utils, and that's it. If the answer is no, then implement something in pgbench directly.
The structure of variables is different, the container structure of the variables is different, so I think that the answer is no.
-- Marina Polyakova Postgres Professional: http://www.postgrespro.com The Russian Postgres Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers