From 2af9a44fa97080b3c5cf0b8e789642efff3d14a6 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 13 Aug 2005 19:02:34 +0000 Subject: Make pg_stat_file() use OUT parameters so that the user doesn't have to remember the output parameter set for himself. It's a bit of a kluge but fixing array_in to work in bootstrap mode looks worse. I removed the separate pg_file_length() function, as it no longer has any real notational advantage --- you can write (pg_stat_file(...)).length. --- doc/src/sgml/func.sgml | 111 ++++++++++++++++++++++--------------------------- 1 file changed, 49 insertions(+), 62 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 7790615d24a..d9495e8ee48 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,5 +1,5 @@ @@ -9064,6 +9064,9 @@ SELECT set_config('log_statement_stats', 'off', false); pg_reload_conf + + pg_rotate_logfile + signal @@ -9100,23 +9103,44 @@ SELECT set_config('log_statement_stats', 'off', false); int Cause server processes to reload their configuration files + + + pg_rotate_logfile() + + int + Rotate server's logfile + - These functions return 1 if successful, 0 if not successful. - The process ID (pid) of an active backend can be found - from the procpid column in the - pg_stat_activity view, or by listing the postgres - processes on the server with ps. + Each of these functions returns 1 if successful, 0 if not successful. + + + + pg_cancel_backend sends a Query Cancel (SIGINT) signal + to a backend process identified by process ID (pid). + The process ID of an active backend can be found from the + procpid column in the + pg_stat_activity view, or by listing the + postgres processes on the server with + ps. + pg_reload_conf sends a SIGHUP signal to the postmaster, causing reload of the configuration files in all server processes. + + pg_rotate_logfile signals the logfile manager to switch + to a new output file immediately. This works only when + redirect_stderr is used for logging, since otherwise there + is no logfile manager subprocess. + + pg_start_backup @@ -9341,22 +9365,9 @@ SELECT set_config('log_statement_stats', 'off', false); - - - pg_file_length(filename text) - - pg_file_length - - - int8 - Return the file length - pg_ls_dir(dirname text) - - pg_ls_dir - setof text List the contents of a directory @@ -9373,69 +9384,45 @@ SELECT set_config('log_statement_stats', 'off', false); pg_stat_file(filename text) record - Return information about the file + Return information about a file + + pg_ls_dir + + + pg_ls_dir() returns all the names in the specified + directory, except the special entries . and + ... + + pg_read_file - pg_read_file() returns part of a textfile, starting - at the given offset, returning at most length bytes (less if the - end of file is reached first). If offset is negative, - it is relative to the end of the file. + pg_read_file() returns part of a text file, starting + at the given offset, returning at most length + bytes (less if the end of file is reached first). If offset + is negative, it is relative to the end of the file. pg_stat_file - pg_stat_file() returns a record containing the + pg_stat_file() returns a record containing the file length, last accessed timestamp, last modified timestamp, - creation timestamp, and a flag indicating if it is a directory. - Use it like this: + creation timestamp, and a boolean indicating if it is a directory. + Typical usages include: -SELECT * -FROM pg_stat_file('filename') - AS s(length int8, atime timestamptz, mtime timestamptz, - ctime timestamptz, isdir bool); +SELECT * FROM pg_stat_file('filename'); +SELECT (pg_stat_file('filename')).mtime; - - The function shown in forces the server - logfile to be rotated. This works only when redirect_stderr - is used for logging. Use of this function is restricted - to superusers. - - - - Server Logfile Functions - - - Name Return Type Description - - - - - - - pg_rotate_logfile() - - pg_rotate_logfile - - - int - Rotate server's logfile - - - -
- -- cgit v1.2.3