From 7e137f846df2431ce9c61202dcea21ee4a6d7822 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Tue, 1 Mar 2016 13:04:09 -0500 Subject: Extend pgbench's expression syntax to support a few built-in functions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fabien Coelho, reviewed mostly by Michael Paquier and me, but also by Heikki Linnakangas, BeomYong Lee, Kyotaro Horiguchi, Oleksander Shulgin, and Álvaro Herrera. --- doc/src/sgml/ref/pgbench.sgml | 64 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 3 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml index ade1b530d26..f39f341a269 100644 --- a/doc/src/sgml/ref/pgbench.sgml +++ b/doc/src/sgml/ref/pgbench.sgml @@ -786,7 +786,7 @@ pgbench options dbname - + \set varname expression @@ -798,8 +798,10 @@ pgbench options dbname The expression may contain integer constants such as 5432, references to variables :variablename, and expressions composed of unary (-) or binary operators - (+, -, *, /, %) - with their usual associativity, and parentheses. + (+, -, *, /, + %) with their usual associativity, + function calls, and + parentheses. @@ -994,6 +996,62 @@ END; + + Built-In Functions + + + The following functions are built into pgbench and + may be used in conjunction with + \set. + + + + + pgbench Functions + + + + Function + Return Type + Description + Example + Result + + + + + abs(a) + same as a + integer value + abs(-17) + 17 + + + debug(a) + same as a + print to stderr the given argument + debug(5432) + 5432 + + + max(i [, ... ] ) + integer + maximum value + max(5, 4, 3, 2) + 5 + + + min(i [, ... ] ) + integer + minimum value + min(5, 4, 3, 2) + 2 + + + +
+
+ Per-Transaction Logging -- cgit v1.2.3