Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit25ee705

Browse files
committed
pgbench: Remove \cset
Partial revert of commit6260cc5, "pgbench: add \cset and \gsetcommands".While \gset is widely considered a useful and necessary tool for user-defined benchmarks, \cset does not have as much value, and itsimplementation was considered "not to be up to project standards"(though I, Álvaro, can't quite understand exactly how). Therefore,remove \cset.Author: Fabien CoelhoDiscussion:https://postgr.es/m/alpine.DEB.2.21.1903230716030.18811@lancreDiscussion:https://postgr.es/m/201901101900.mv7zduch6sad@alvherre.pgsql
1 parent6f97457 commit25ee705

File tree

6 files changed

+56
-238
lines changed

6 files changed

+56
-238
lines changed

‎doc/src/sgml/ref/pgbench.sgml

Lines changed: 3 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -963,57 +963,15 @@ pgbench <optional> <replaceable>options</replaceable> </optional> <replaceable>d
963963
</para>
964964

965965
<variablelist>
966-
<varlistentry id='pgbench-metacommand-cset'>
967-
<term>
968-
<literal>\cset [<replaceable>prefix</replaceable>]</literal>
969-
</term>
970-
971-
<listitem>
972-
<para>
973-
This command may be used to end SQL queries, replacing an embedded
974-
semicolon (<literal>\;</literal>) within a compound SQL command.
975-
</para>
976-
977-
<para>
978-
When this command is used, the preceding SQL query is expected to
979-
return one row, the columns of which are stored into variables named after
980-
column names, and prefixed with <replaceable>prefix</replaceable> if provided.
981-
</para>
982-
983-
<para>
984-
The following example sends four queries as one compound SQL command,
985-
inducing one message sent at the protocol level.
986-
The result of the first query is stored into variable <replaceable>one</replaceable>,
987-
the results of the third query are stored into variables <replaceable>z_three</replaceable>
988-
and <replaceable>z_four</replaceable>,
989-
whereas the results of the other queries are discarded.
990-
<programlisting>
991-
-- compound of four queries
992-
SELECT 1 AS one \cset
993-
SELECT 2 AS two \;
994-
SELECT 3 AS three, 4 AS four \cset z_
995-
SELECT 5;
996-
</programlisting>
997-
</para>
998-
999-
<note>
1000-
<para>
1001-
<literal>\cset</literal> does not work when empty SQL queries appear
1002-
within a compound SQL command.
1003-
</para>
1004-
</note>
1005-
</listitem>
1006-
</varlistentry>
1007-
1008966
<varlistentry id='pgbench-metacommand-gset'>
1009967
<term>
1010968
<literal>\gset [<replaceable>prefix</replaceable>]</literal>
1011969
</term>
1012970

1013971
<listitem>
1014972
<para>
1015-
This command may be used to end SQL queries,replacing a final semicolon
1016-
(<literal>;</literal>).
973+
This command may be used to end SQL queries,taking the place of the
974+
terminating semicolon(<literal>;</literal>).
1017975
</para>
1018976

1019977
<para>
@@ -1026,7 +984,7 @@ SELECT 5;
1026984
The following example puts the final account balance from the first query
1027985
into variable <replaceable>abalance</replaceable>, and fills variables
1028986
<replaceable>p_two</replaceable> and <replaceable>p_three</replaceable>
1029-
with integers from thelast query.
987+
with integers from thethird query.
1030988
The result of the second query is discarded.
1031989
<programlisting>
1032990
UPDATE pgbench_accounts
@@ -1038,13 +996,6 @@ SELECT 1 \;
1038996
SELECT 2 AS two, 3 AS three \gset p_
1039997
</programlisting>
1040998
</para>
1041-
1042-
<note>
1043-
<para>
1044-
<literal>\gset</literal> does not work when empty SQL queries appear
1045-
within a compound SQL command.
1046-
</para>
1047-
</note>
1048999
</listitem>
10491000
</varlistentry>
10501001

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp