Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Appendix B. Backend Options for postgres

The postgres program is the actual backend server that processes SQL statements. It is generally not called directly, but invoked through the multiuser postmaster process. It can be helpful to know the options available to this program, however, as they can be called indirectly through the postmaster 's -o  flag.

The following syntax diagram shows the options recognized by postgres:

  postgres [ -A { 0 | 1 } ] [ -B buffers ] [ -c name=value ] [ -d debug-level ]
           [ -D datadir ] [ -e ] [ -E ] [ -f { s | i | n | m | h } ] [ -F ] 
           [ -i ] [ -L ] [ -N ] [ -o file-name ] [ -O ] [ -P ] 
           [ -s | -t { pa | pl | ex } ] [ -S sort_mem ] [ -W num ] database
  
  postgres [ -A { 0 | 1 } ] [ -B buffers ] [ -c name=value ] [ -d debug-level ]
           [ -D datadir ] [ -e ] [ -f { s | i | n | m | h } ] [ -F ] [ -i ] 
           [ -L ] [ -o file-name ] [ -O ] [ -p database ] [ -P ] 
           [ -s | -t { pa | pl | ex } ] [ -S sort_mem ] [ -v version ] [ -W num ]

-A { 0 | 1 }

The run-time assertion check parameter. This enables debugging, if the debugging option was enabled during compilation of PostgreSQL. This parameter should only be used by knowledgeable developers working on PostgreSQL.

-B buffers

The number of shared-memory disk buffers that postmaster will allocate for use by the backend. By default, this is 64.

Note: The buffers value passed to -B must be at least twice the number supplied for the -N parameter.

-c name=value

An arbitrary run-time configuration, setting name to value. Any configuration settings found in the postgresql.conf file (within the database cluster's data directory) may be over-ridden with this option.

-d debug_level

The debug level, which determines the amount of debugging output that will be logged by the backend. The default is 0. With a higher the debug_level number, more output will be generated. Values as high as 4 are reasonable for normal use, though this can log a great deal of information.

Note: Unless the standard output and standard error streams from postmaster are redirected to a file (e.g., from the shell, or with the -l option to pg_ctl) all debugging information will be displayed to the controlling terminal session of the postmaster process.

-D datadir

The data directory of the intended database cluster. If this is not supplied, postmaster will use either the value of the PGDATA environment variable, or the /data path off of the path defined in the POSTGRESHOME environment variable. If neither environment variable is set, the default compile-time directory is used (e.g., /usr/local/pgsql/data).

-e

The European date style parameter. This causes PostgreSQL to assume that dates such as 3/2/2001 are day-first rather than month-first. It also causes PostgreSQL to display the day before the month (e.g., dd/mm/yyyy) when displaying dates.

-E

The verbose echo parameter. Causes all passed statements to be output (e.g., to the controlling terminal session, or to the server log).

-f { s | i | n | m | h }

The forbid parameter, which can forbid the use of certain scan and join methods. The following options may follow the -f:

s

Forbids sequential scans

i

Forbids index scans

n

Forbids nested loops

m

Forbids merge joins

h

Forbids hash joins

-F

The fsync-disabling option. Using this increases performance at the risk of data corruption in the event that the operating system or physical hardware crashes unexpectedly. Be sure you know what you are doing before you use this parameter!

-i

The -i parameter disables query execution, and causes PostgreSQL to only show the plan tree.

-L

The lock-disabling parameter. This turns off the ability to lock in PostgreSQL.

-N

The -N parameter disables the use of a newline as a statement delimiter.

-O

The -O parameter allows system tables to be modified.

-p database

The postmaster parameter, indicating that this postgres instance was started by postmaster connecting to database. This causes postgres to make different decisions about memory management and file descriptors.

-P

The -P parameter causes PostgreSQL to ignore system indices when scanning and updating system tuples. This option is required by the REINDEX command when indexing system tables.

-s

The statistics parameter. This causes PostgreSQL to display processing time and other statistics after each query, which can be helpful in benchmark tests, or for tuning the amount of buffers you make available with the -B parameter.

-S sort_mem

The amount of memory to be allocated for internal sorting and hashes before falling back on temporary hard disk files. sort_mem is a numeric value, in kilobytes, and defaults to 512. For complex statements, several sorts or hashes may run simultaneously; each one will be allocated up to the value specified by sort_mem before using temporary disk space.

-t { pa | pl | e }

The timing statistics parameter, specific to only one of the major postgres components. The following are the valid options that may follow the -t parameter:

pa

Times the parser component

pl

Times the planner component

e

Times the executor component

The -t and -s options are mutually exclusive.

-v version

The protocol version parameter. This option sets the internal version number of the frontend-to-backend protocol.

-W num

The wait parameter. Specifying this value causes postgres to wait for num seconds before starting up, allowing a developer time to attach a debugger.


 
 
  Published courtesy of O'Reilly Design by Interspire