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

Commit7ef5634

Browse files
committed
Here is a doc patch for the SHOW X changes and new config-settings
functions. If there are no objections, please apply.Joe Conway
1 parent22c64f1 commit7ef5634

File tree

3 files changed

+166
-5
lines changed

3 files changed

+166
-5
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 116 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.105 2002/07/31 02:27:28 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.106 2002/08/04 03:53:10 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -4441,6 +4441,121 @@ SELECT NULLIF(value, '(none)') ...
44414441
server's version.
44424442
</para>
44434443

4444+
<table>
4445+
<title>Configuration Settings Information Functions</title>
4446+
<tgroup cols="3">
4447+
<thead>
4448+
<row><entry>Name</entry> <entry>Return Type</entry> <entry>Description</entry></row>
4449+
</thead>
4450+
4451+
<tbody>
4452+
<row>
4453+
<entry>
4454+
<function>current_setting</function>(<parameter>setting_name</parameter>)
4455+
</entry>
4456+
<entry><type>text</type></entry>
4457+
<entry>value of current setting</entry>
4458+
</row>
4459+
<row>
4460+
<entry>
4461+
<function>set_config(<parameter>setting_name</parameter>,
4462+
<parameter>new_value</parameter>,
4463+
<parameter>is_local</parameter>)</function>
4464+
</entry>
4465+
<entry><type>text</type></entry>
4466+
<entry>new value of current setting</entry>
4467+
</row>
4468+
</tbody>
4469+
</tgroup>
4470+
</table>
4471+
4472+
<indexterm zone="functions-misc">
4473+
<primary>setting</primary>
4474+
<secondary>current</secondary>
4475+
</indexterm>
4476+
4477+
<indexterm zone="functions-misc">
4478+
<primary>setting</primary>
4479+
<secondary>set</secondary>
4480+
</indexterm>
4481+
4482+
<para>
4483+
The <function>current_setting</function> is used to obtain the current
4484+
value of the <parameter>setting_name</parameter> setting, as a query
4485+
result. It is the equivalent to the SQL <command>SHOW</command> command.
4486+
For example:
4487+
<programlisting>
4488+
select current_setting('DateStyle');
4489+
current_setting
4490+
---------------------------------------
4491+
ISO with US (NonEuropean) conventions
4492+
(1 row)
4493+
</programlisting>
4494+
</para>
4495+
4496+
<para>
4497+
<function>set_config</function> allows the <parameter>setting_name
4498+
</parameter> setting to be changed to <parameter>new_value</parameter>.
4499+
If <parameter>is_local</parameter> is set to <literal>true</literal>,
4500+
the new value will only apply to the current transaction. If you want
4501+
the new value to apply for the current session, use
4502+
<literal>false</literal> instead. It is the equivalent to the SQL
4503+
<command>SET</command> command. For example:
4504+
<programlisting>
4505+
SHOW show_query_stats;
4506+
show_query_stats
4507+
------------------
4508+
on
4509+
(1 row)
4510+
4511+
select set_config('show_query_stats','off','f');
4512+
set_config
4513+
------------
4514+
off
4515+
(1 row)
4516+
4517+
SHOW show_query_stats;
4518+
show_query_stats
4519+
------------------
4520+
off
4521+
(1 row)
4522+
4523+
select set_config('show_query_stats','on','t');
4524+
set_config
4525+
------------
4526+
on
4527+
(1 row)
4528+
4529+
SHOW show_query_stats;
4530+
show_query_stats
4531+
------------------
4532+
off
4533+
(1 row)
4534+
4535+
BEGIN;
4536+
BEGIN
4537+
select set_config('show_query_stats','on','t');
4538+
set_config
4539+
------------
4540+
on
4541+
(1 row)
4542+
4543+
SHOW show_query_stats;
4544+
show_query_stats
4545+
------------------
4546+
on
4547+
(1 row)
4548+
4549+
COMMIT;
4550+
COMMIT
4551+
SHOW show_query_stats;
4552+
show_query_stats
4553+
------------------
4554+
off
4555+
(1 row)
4556+
</programlisting>
4557+
</para>
4558+
44444559
<table>
44454560
<title>Access Privilege Inquiry Functions</title>
44464561
<tgroup cols="3">

‎doc/src/sgml/ref/set.sgml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.62 2002/06/11 15:41:30 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.63 2002/08/04 03:53:11 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -495,6 +495,16 @@ SELECT CURRENT_TIMESTAMP AS today;
495495
</para>
496496
</refsect2>
497497
</refsect1>
498+
499+
<refsect1>
500+
<title>See Also</title>
501+
502+
<para>
503+
The function <function>set_config</function> provides the equivalent
504+
capability. See <citetitle>Miscellaneous Functions</citetitle> in the
505+
<citetitle>PostgreSQL User's Guide</citetitle>.
506+
</para>
507+
</refsect1>
498508
</refentry>
499509

500510
<!-- Keep this comment at the end of the file

‎doc/src/sgml/ref/show.sgml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/show.sgml,v 1.17 2002/05/17 01:19:16 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/show.sgml,v 1.18 2002/08/04 03:53:11 momjian Exp $
33
PostgreSQL documentation
44
-->
55

@@ -83,17 +83,43 @@ SHOW ALL
8383

8484
<screen>
8585
SHOW DateStyle;
86-
INFO: DateStyle is ISO with US (NonEuropean) conventions
86+
DateStyle
87+
---------------------------------------
88+
ISO with US (NonEuropean) conventions
89+
(1 row)
8790
</screen>
8891
</para>
8992

9093
<para>
9194
Show the current genetic optimizer (<literal>geqo</literal>) setting:
9295
<screen>
9396
SHOW GEQO;
94-
INFO: geqo is on
97+
geqo
98+
------
99+
on
100+
(1 row)
95101
</screen>
96102
</para>
103+
104+
<para>
105+
Show all settings:
106+
<screen>
107+
SHOW ALL;
108+
name | setting
109+
-------------------------------+---------------------------------------
110+
australian_timezones | off
111+
authentication_timeout | 60
112+
checkpoint_segments | 3
113+
.
114+
.
115+
.
116+
wal_debug | 0
117+
wal_files | 0
118+
wal_sync_method | fdatasync
119+
(94 rows)
120+
</screen>
121+
</para>
122+
97123
</refsect1>
98124

99125
<refsect1 id="R1-SQL-SHOW-3">
@@ -104,6 +130,16 @@ INFO: geqo is on
104130
<productname>PostgreSQL</productname> extension.
105131
</para>
106132
</refsect1>
133+
134+
<refsect1>
135+
<title>See Also</title>
136+
137+
<para>
138+
The function <function>current_setting</function> produces equivalent
139+
output. See <citetitle>Miscellaneous Functions</citetitle> in the
140+
<citetitle>PostgreSQL User's Guide</citetitle>.
141+
</para>
142+
</refsect1>
107143
</refentry>
108144

109145
<!-- Keep this comment at the end of the file

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp