|
1 | 1 | <!--
|
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 $ |
3 | 3 | PostgreSQL documentation
|
4 | 4 | -->
|
5 | 5 |
|
@@ -4441,6 +4441,121 @@ SELECT NULLIF(value, '(none)') ...
|
4441 | 4441 | server's version.
|
4442 | 4442 | </para>
|
4443 | 4443 |
|
| 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 | + |
4444 | 4559 | <table>
|
4445 | 4560 | <title>Access Privilege Inquiry Functions</title>
|
4446 | 4561 | <tgroup cols="3">
|
|
0 commit comments