1
1
<!--
2
- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.278 2005/08/12 15:57:48 momjian Exp $
2
+ $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.279 2005/08/12 18:23:53 tgl Exp $
3
3
PostgreSQL documentation
4
4
-->
5
5
@@ -9072,13 +9072,13 @@ SELECT set_config('log_statement_stats', 'off', false);
9072
9072
9073
9073
<para>
9074
9074
The functions shown in <xref
9075
- linkend="functions-admin-signal-table"> sends control signals to
9076
- other server processes. Use of this function is restricted
9075
+ linkend="functions-admin-signal-table"> send control signals to
9076
+ other server processes. Use of these functions is restricted
9077
9077
to superusers.
9078
9078
</para>
9079
9079
9080
9080
<table id="functions-admin-signal-table">
9081
- <title>Backend Signalling Functions</title>
9081
+ <title>Server Signalling Functions</title>
9082
9082
<tgroup cols="3">
9083
9083
<thead>
9084
9084
<row><entry>Name</entry> <entry>Return Type</entry> <entry>Description</entry>
@@ -9088,7 +9088,7 @@ SELECT set_config('log_statement_stats', 'off', false);
9088
9088
<tbody>
9089
9089
<row>
9090
9090
<entry>
9091
- <literal><function>pg_cancel_backend</function>(<parameter>pid</parameter>)</literal>
9091
+ <literal><function>pg_cancel_backend</function>(<parameter>pid</parameter> <type>int</> )</literal>
9092
9092
</entry>
9093
9093
<entry><type>int</type></entry>
9094
9094
<entry>Cancel a backend's current query</entry>
@@ -9098,7 +9098,7 @@ SELECT set_config('log_statement_stats', 'off', false);
9098
9098
<literal><function>pg_reload_conf</function>()</literal>
9099
9099
</entry>
9100
9100
<entry><type>int</type></entry>
9101
- <entry>Causes server processes to reload their configuration files</entry>
9101
+ <entry>Cause server processes to reload their configuration files</entry>
9102
9102
</row>
9103
9103
</tbody>
9104
9104
</tgroup>
@@ -9113,8 +9113,8 @@ SELECT set_config('log_statement_stats', 'off', false);
9113
9113
</para>
9114
9114
<para>
9115
9115
<function>pg_reload_conf</> sends a SIGHUP signal to the
9116
- postmaster, causing the reload of the configuration files
9117
- in all backend processes.
9116
+ postmaster, causing reload of the configuration files
9117
+ in all server processes.
9118
9118
</para>
9119
9119
9120
9120
<indexterm zone="functions-admin">
@@ -9144,7 +9144,7 @@ SELECT set_config('log_statement_stats', 'off', false);
9144
9144
<tbody>
9145
9145
<row>
9146
9146
<entry>
9147
- <literal><function>pg_start_backup</function>(<parameter>label_text</parameter >)</literal>
9147
+ <literal><function>pg_start_backup</function>(<parameter>label</> <type>text</ >)</literal>
9148
9148
</entry>
9149
9149
<entry><type>text</type></entry>
9150
9150
<entry>Set up for performing on-line backup</entry>
@@ -9219,64 +9219,64 @@ SELECT set_config('log_statement_stats', 'off', false);
9219
9219
9220
9220
<tbody>
9221
9221
<row>
9222
- <entry><function>pg_column_size</function>(<parameter >any</parameter >)</entry>
9222
+ <entry><function>pg_column_size</function>(<type >any</type >)</entry>
9223
9223
<entry><type>integer</type></entry>
9224
9224
<entry>Number of bytes used to store a particular value (possibly compressed)</entry>
9225
9225
</row>
9226
9226
<row>
9227
9227
<entry>
9228
- <literal><function>pg_tablespace_size</function>(<parameter >oid</parameter >)</literal>
9228
+ <literal><function>pg_tablespace_size</function>(<type >oid</type >)</literal>
9229
9229
</entry>
9230
9230
<entry><type>bigint</type></entry>
9231
9231
<entry>Total disk space used by the tablespace with the specified OID</entry>
9232
9232
</row>
9233
9233
<row>
9234
9234
<entry>
9235
- <literal><function>pg_tablespace_size</function>(<parameter >name</parameter >)</literal>
9235
+ <literal><function>pg_tablespace_size</function>(<type >name</type >)</literal>
9236
9236
</entry>
9237
9237
<entry><type>bigint</type></entry>
9238
9238
<entry>Total disk space used by the tablespace with the specified name</entry>
9239
9239
</row>
9240
9240
<row>
9241
9241
<entry>
9242
- <literal><function>pg_database_size</function>(<parameter >oid</parameter >)</literal>
9242
+ <literal><function>pg_database_size</function>(<type >oid</type >)</literal>
9243
9243
</entry>
9244
9244
<entry><type>bigint</type></entry>
9245
9245
<entry>Total disk space used by the database with the specified OID</entry>
9246
9246
</row>
9247
9247
<row>
9248
9248
<entry>
9249
- <literal><function>pg_database_size</function>(<parameter >name</parameter >)</literal>
9249
+ <literal><function>pg_database_size</function>(<type >name</type >)</literal>
9250
9250
</entry>
9251
9251
<entry><type>bigint</type></entry>
9252
9252
<entry>Total disk space used by the database with the specified name</entry>
9253
9253
</row>
9254
9254
<row>
9255
9255
<entry>
9256
- <literal><function>pg_relation_size</function>(<parameter >oid</parameter >)</literal>
9256
+ <literal><function>pg_relation_size</function>(<type >oid</type >)</literal>
9257
9257
</entry>
9258
9258
<entry><type>bigint</type></entry>
9259
9259
<entry>Disk space used by the table or index with the specified OID</entry>
9260
9260
</row>
9261
9261
<row>
9262
9262
<entry>
9263
- <literal><function>pg_relation_size</function>(<parameter >text</parameter >)</literal>
9263
+ <literal><function>pg_relation_size</function>(<type >text</type >)</literal>
9264
9264
</entry>
9265
9265
<entry><type>bigint</type></entry>
9266
9266
<entry>Disk space used by the table or index with the specified name.
9267
9267
The name may be qualified with a schema name</entry>
9268
9268
</row>
9269
9269
<row>
9270
9270
<entry>
9271
- <literal><function>pg_complete_relation_size</function>(<parameter >oid</parameter >)</literal>
9271
+ <literal><function>pg_complete_relation_size</function>(<type >oid</type >)</literal>
9272
9272
</entry>
9273
9273
<entry><type>bigint</type></entry>
9274
9274
<entry>Total disk space used by the table with the specified OID,
9275
9275
including indexes and toasted data</entry>
9276
9276
</row>
9277
9277
<row>
9278
9278
<entry>
9279
- <literal><function>pg_complete_relation_size</function>(<parameter >text</parameter >)</literal>
9279
+ <literal><function>pg_complete_relation_size</function>(<type >text</type >)</literal>
9280
9280
</entry>
9281
9281
<entry><type>bigint</type></entry>
9282
9282
<entry>Total disk space used by the table with the specified name,
@@ -9285,7 +9285,7 @@ SELECT set_config('log_statement_stats', 'off', false);
9285
9285
</row>
9286
9286
<row>
9287
9287
<entry>
9288
- <literal><function>pg_size_pretty</function>(<parameter >bigint</parameter >)</literal>
9288
+ <literal><function>pg_size_pretty</function>(<type >bigint</type >)</literal>
9289
9289
</entry>
9290
9290
<entry><type>text</type></entry>
9291
9291
<entry>Converts a size in bytes into a human-readable format with size units</entry>
@@ -9325,11 +9325,11 @@ SELECT set_config('log_statement_stats', 'off', false);
9325
9325
<para>
9326
9326
The functions shown in <xref
9327
9327
linkend="functions-admin-genfile"> provide native file access to
9328
- files on the machine hosting the server. Only files relative to
9329
- the cluster directory are allowed, and the <varname>log_directory</>,
9330
- because the log file directory might be stored outside the
9331
- cluster directory. Use of these functions is restricted to
9332
- superusers.
9328
+ files on the machine hosting the server. Only files within the
9329
+ database cluster directory and the <varname>log_directory</> may be
9330
+ accessed. Use a relative path for files within the cluster directory,
9331
+ and a path matching the <varname>log_directory</> configuration setting
9332
+ for log files. Use of these functions is restricted to superusers.
9333
9333
</para>
9334
9334
9335
9335
<table id="functions-admin-genfile">
@@ -9343,17 +9343,17 @@ SELECT set_config('log_statement_stats', 'off', false);
9343
9343
<tbody>
9344
9344
<row>
9345
9345
<entry>
9346
- <literal><function>pg_file_length</function>(<parameter>filename_text</parameter >)</literal>
9346
+ <literal><function>pg_file_length</function>(<parameter>filename</> <type>text</ >)</literal>
9347
9347
<indexterm zone="functions-admin">
9348
9348
<primary>pg_file_length</primary>
9349
9349
</indexterm>
9350
9350
</entry>
9351
9351
<entry><type>int8</type></entry>
9352
- <entry>Returns the file length</entry>
9352
+ <entry>Return the file length</entry>
9353
9353
</row>
9354
9354
<row>
9355
9355
<entry>
9356
- <literal><function>pg_ls_dir</function>(<parameter>dirname_text</parameter>,<parameter>fullpath_bool</parameter >)</literal>
9356
+ <literal><function>pg_ls_dir</function>(<parameter>dirname</> <type>text</ >)</literal>
9357
9357
<indexterm zone="functions-admin">
9358
9358
<primary>pg_ls_dir</primary>
9359
9359
</indexterm>
@@ -9363,18 +9363,17 @@ SELECT set_config('log_statement_stats', 'off', false);
9363
9363
</row>
9364
9364
<row>
9365
9365
<entry>
9366
- <literal><function>pg_read_file</function>(<parameter>filename_text</parameter>,
9367
- <parameter>offset_int8</parameter>,<parameter>length_int8</parameter>)</literal>
9366
+ <literal><function>pg_read_file</function>(<parameter>filename</> <type>text</>, <parameter>offset</> <type>int8</>, <parameter>length</> <type>int8</>)</literal>
9368
9367
</entry>
9369
9368
<entry><type>text</type></entry>
9370
- <entry>Returns the contents of a text file</entry>
9369
+ <entry>Return the contents of a text file</entry>
9371
9370
</row>
9372
9371
<row>
9373
9372
<entry>
9374
- <literal><function>pg_stat_file</function>(<parameter>filename_text</parameter >)</literal>
9373
+ <literal><function>pg_stat_file</function>(<parameter>filename</> <type>text</ >)</literal>
9375
9374
</entry>
9376
9375
<entry><type>record</type></entry>
9377
- <entry>Returns information about the file</entry>
9376
+ <entry>Return information about the file</entry>
9378
9377
</row>
9379
9378
</tbody>
9380
9379
</tgroup>
@@ -9385,8 +9384,9 @@ SELECT set_config('log_statement_stats', 'off', false);
9385
9384
</indexterm>
9386
9385
<para>
9387
9386
<function>pg_read_file()</> returns part of a textfile, starting
9388
- at the given offset, returning length bytes. If offset is negative,
9389
- it is treated relative to the end of the file.
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.
9390
9390
</para>
9391
9391
9392
9392
<indexterm zone="functions-admin">
@@ -9396,18 +9396,25 @@ SELECT set_config('log_statement_stats', 'off', false);
9396
9396
<function>pg_stat_file()</> returns a record containing the
9397
9397
length, last accessed timestamp, last modified timestamp,
9398
9398
creation timestamp, and a flag indicating if it is a directory.
9399
+ Use it like this:
9400
+ <programlisting>
9401
+ SELECT *
9402
+ FROM pg_stat_file('filename')
9403
+ AS s(length int8, atime timestamptz, mtime timestamptz,
9404
+ ctime timestamptz, isdir bool);
9405
+ </programlisting>
9399
9406
</para>
9400
9407
9401
9408
<para>
9402
9409
The function shown in <xref
9403
9410
linkend="functions-admin-logfile"> forces the server
9404
- logfile to be rotated if <varname>redirect_stderr</>
9405
- is used for logging. Use of this functions is restricted
9411
+ logfile to be rotated. This works only when <varname>redirect_stderr</>
9412
+ is used for logging. Use of this function is restricted
9406
9413
to superusers.
9407
9414
</para>
9408
9415
9409
9416
<table id="functions-admin-logfile">
9410
- <title>Backend Logfile Functions</title>
9417
+ <title>Server Logfile Functions</title>
9411
9418
<tgroup cols="3">
9412
9419
<thead>
9413
9420
<row><entry>Name</entry> <entry>Return Type</entry> <entry>Description</entry>
@@ -9423,7 +9430,7 @@ SELECT set_config('log_statement_stats', 'off', false);
9423
9430
</indexterm>
9424
9431
</entry>
9425
9432
<entry><type>int</type></entry>
9426
- <entry>Rotate logfile</entry>
9433
+ <entry>Rotate server's logfile</entry>
9427
9434
</row>
9428
9435
</tbody>
9429
9436
</tgroup>
0 commit comments