1
1
<!--
2
- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.279 2005/08/12 18:23:53 tgl Exp $
2
+ $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.280 2005/08/13 19:02:32 tgl Exp $
3
3
PostgreSQL documentation
4
4
-->
5
5
@@ -9064,6 +9064,9 @@ SELECT set_config('log_statement_stats', 'off', false);
9064
9064
<indexterm zone="functions-admin">
9065
9065
<primary>pg_reload_conf</primary>
9066
9066
</indexterm>
9067
+ <indexterm zone="functions-admin">
9068
+ <primary>pg_rotate_logfile</primary>
9069
+ </indexterm>
9067
9070
9068
9071
<indexterm zone="functions-admin">
9069
9072
<primary>signal</primary>
@@ -9100,23 +9103,44 @@ SELECT set_config('log_statement_stats', 'off', false);
9100
9103
<entry><type>int</type></entry>
9101
9104
<entry>Cause server processes to reload their configuration files</entry>
9102
9105
</row>
9106
+ <row>
9107
+ <entry>
9108
+ <literal><function>pg_rotate_logfile</function>()</literal>
9109
+ </entry>
9110
+ <entry><type>int</type></entry>
9111
+ <entry>Rotate server's logfile</entry>
9112
+ </row>
9103
9113
</tbody>
9104
9114
</tgroup>
9105
9115
</table>
9106
9116
9107
9117
<para>
9108
- These functions return 1 if successful, 0 if not successful.
9109
- The process ID (<literal>pid</literal>) of an active backend can be found
9110
- from the <structfield>procpid</structfield> column in the
9111
- <structname>pg_stat_activity</structname> view, or by listing the <command>postgres</command>
9112
- processes on the server with <application>ps</>.
9118
+ Each of these functions returns 1 if successful, 0 if not successful.
9119
+ </para>
9120
+
9121
+ <para>
9122
+ <function>pg_cancel_backend</> sends a Query Cancel (SIGINT) signal
9123
+ to a backend process identified by process ID (<literal>pid</literal>).
9124
+ The process ID of an active backend can be found from the
9125
+ <structfield>procpid</structfield> column in the
9126
+ <structname>pg_stat_activity</structname> view, or by listing the
9127
+ <command>postgres</command> processes on the server with
9128
+ <application>ps</>.
9113
9129
</para>
9130
+
9114
9131
<para>
9115
9132
<function>pg_reload_conf</> sends a SIGHUP signal to the
9116
9133
postmaster, causing reload of the configuration files
9117
9134
in all server processes.
9118
9135
</para>
9119
9136
9137
+ <para>
9138
+ <function>pg_rotate_logfile</> signals the logfile manager to switch
9139
+ to a new output file immediately. This works only when
9140
+ <varname>redirect_stderr</> is used for logging, since otherwise there
9141
+ is no logfile manager subprocess.
9142
+ </para>
9143
+
9120
9144
<indexterm zone="functions-admin">
9121
9145
<primary>pg_start_backup</primary>
9122
9146
</indexterm>
@@ -9341,22 +9365,9 @@ SELECT set_config('log_statement_stats', 'off', false);
9341
9365
</thead>
9342
9366
9343
9367
<tbody>
9344
- <row>
9345
- <entry>
9346
- <literal><function>pg_file_length</function>(<parameter>filename</> <type>text</>)</literal>
9347
- <indexterm zone="functions-admin">
9348
- <primary>pg_file_length</primary>
9349
- </indexterm>
9350
- </entry>
9351
- <entry><type>int8</type></entry>
9352
- <entry>Return the file length</entry>
9353
- </row>
9354
9368
<row>
9355
9369
<entry>
9356
9370
<literal><function>pg_ls_dir</function>(<parameter>dirname</> <type>text</>)</literal>
9357
- <indexterm zone="functions-admin">
9358
- <primary>pg_ls_dir</primary>
9359
- </indexterm>
9360
9371
</entry>
9361
9372
<entry><type>setof text</type></entry>
9362
9373
<entry>List the contents of a directory</entry>
@@ -9373,69 +9384,45 @@ SELECT set_config('log_statement_stats', 'off', false);
9373
9384
<literal><function>pg_stat_file</function>(<parameter>filename</> <type>text</>)</literal>
9374
9385
</entry>
9375
9386
<entry><type>record</type></entry>
9376
- <entry>Return information about the file</entry>
9387
+ <entry>Return information about a file</entry>
9377
9388
</row>
9378
9389
</tbody>
9379
9390
</tgroup>
9380
9391
</table>
9381
9392
9393
+ <indexterm zone="functions-admin">
9394
+ <primary>pg_ls_dir</primary>
9395
+ </indexterm>
9396
+ <para>
9397
+ <function>pg_ls_dir()</> returns all the names in the specified
9398
+ directory, except the special entries <quote><literal>.</></> and
9399
+ <quote><literal>..</></>.
9400
+ </para>
9401
+
9382
9402
<indexterm zone="functions-admin">
9383
9403
<primary>pg_read_file</primary>
9384
9404
</indexterm>
9385
9405
<para>
9386
- <function>pg_read_file()</> returns part of a textfile , starting
9387
- at the given offset, returning at most length bytes (less if the
9388
- end of file is reached first). If offset is negative,
9389
- it is relative to the end of the file.
9406
+ <function>pg_read_file()</> returns part of a text file , starting
9407
+ at the given <parameter> offset</> , returning at most <parameter> length</>
9408
+ bytes (less if the end of file is reached first). If <parameter> offset</>
9409
+ is negative, it is relative to the end of the file.
9390
9410
</para>
9391
9411
9392
9412
<indexterm zone="functions-admin">
9393
9413
<primary>pg_stat_file</primary>
9394
9414
</indexterm>
9395
9415
<para>
9396
- <function>pg_stat_file()</> returns a record containing the
9416
+ <function>pg_stat_file()</> returns a record containing the file
9397
9417
length, last accessed timestamp, last modified timestamp,
9398
- creation timestamp, and a flag indicating if it is a directory.
9399
- Use it like this :
9418
+ creation timestamp, and a boolean indicating if it is a directory.
9419
+ Typical usages include :
9400
9420
<programlisting>
9401
- SELECT *
9402
- FROM pg_stat_file('filename')
9403
- AS s(length int8, atime timestamptz, mtime timestamptz,
9404
- ctime timestamptz, isdir bool);
9421
+ SELECT * FROM pg_stat_file('filename');
9422
+ SELECT (pg_stat_file('filename')).mtime;
9405
9423
</programlisting>
9406
9424
</para>
9407
9425
9408
- <para>
9409
- The function shown in <xref
9410
- linkend="functions-admin-logfile"> forces the server
9411
- logfile to be rotated. This works only when <varname>redirect_stderr</>
9412
- is used for logging. Use of this function is restricted
9413
- to superusers.
9414
- </para>
9415
-
9416
- <table id="functions-admin-logfile">
9417
- <title>Server Logfile Functions</title>
9418
- <tgroup cols="3">
9419
- <thead>
9420
- <row><entry>Name</entry> <entry>Return Type</entry> <entry>Description</entry>
9421
- </row>
9422
- </thead>
9423
-
9424
- <tbody>
9425
- <row>
9426
- <entry>
9427
- <literal><function>pg_rotate_logfile</function>()</literal>
9428
- <indexterm zone="functions-admin">
9429
- <primary>pg_rotate_logfile</primary>
9430
- </indexterm>
9431
- </entry>
9432
- <entry><type>int</type></entry>
9433
- <entry>Rotate server's logfile</entry>
9434
- </row>
9435
- </tbody>
9436
- </tgroup>
9437
- </table>
9438
-
9439
9426
</sect1>
9440
9427
</chapter>
9441
9428
0 commit comments