Search PostgreSQL documentation
PG 18 · Browse by category, or enter a name or keyword
Category index4025
Environment Variables17.5.2. Environment Variables
If you installed into /usr/local/pgsql or some other location that is not searched for programs by default, you should add /usr/local/pgsql/bin (or whatever you…Environment Variables
Environment Variables32.15. Environment Variables
The following environment variables can be used to select default connection parameter values, which will be used by PQconnectdb, PQsetdbLogin and PQsetdb if no …Environment Variables
Environment Variables44.11. Environment Variables
Some of the environment variables that are accepted by the Python interpreter can also be used to affect PL/Python behavior. They would need to be set in the env…Environment Variables
Environment Variables31.4.1. Environment Variables
Data directories are named according to the test filename, and will be retained if a test fails. If the environment variable PG_TEST_NOCLEAN is set, data direct…Environment Variables
errno Values of pgtypeslib34.6.7. errno Values of pgtypeslib
PGTYPES_NUM_BAD_NUMERIC # An argument should contain a numeric variable (or point to a numeric variable) but in fact its in-memory representation was inval…errno Values of pgtypeslib
Error and Notice Message Fields54.8. Error and Notice Message Fields
This section describes the fields that can appear in ErrorResponse and NoticeResponse messages. Each field type has a single-byte identification token. …Error and Notice Message Fields
Error Handling34.8. Error Handling
This section describes how you can handle exceptional conditions and warnings in an embedded SQL program. There are two nonexclusive facilities for this.
Callbacks can b…Error Handling
Error Handling32.5.1.3. Error Handling
From the client's perspective, after PQresultStatus returns PGRES_FATAL_ERROR, the pipeline is flagged as aborted. PQresultStatus will report a PGRES_PIPELINE_ABORTE…Error Handling
Error Handling19.14. Error Handling
exit_on_error (boolean) # If on, any error will terminate the current session. By default, this is set to off, so that only FATAL errors will terminate the session. res…Error Handling
Error Handling in PL/Tcl42.8. Error Handling in PL/Tcl
Tcl code within or called from a PL/Tcl function can raise an error, either by executing some invalid operation or by generating an error using the Tcl error c…Error Handling in PL/Tcl
Error Message Differences31.2.1. Error Message Differences
Some of the regression tests involve intentional invalid input values. Error messages can come from either the PostgreSQL code or from the host platform sys…Error Message Differences
Error Message Style Guide55.3. Error Message Style Guide
This style guide is offered in the hope of maintaining a consistent, user-friendly style throughout all the messages generated by PostgreSQL.
What Goes Where …Error Message Style Guide
Error Reporting and Logging19.8. Error Reporting and LoggingError Reporting and Logging
Errors and Messages41.9. Errors and MessagesErrors and Messages
Escaping Strings for Inclusion in SQL Commands32.3.4. Escaping Strings for Inclusion in SQL Commands
PQescapeLiteral
char *PQescapeLiteral(PGconn *conn, const char *str, size_t length); PQescapeLiteral escapes a string for use within an…Escaping Strings for Inclusion in SQL Commands
Event Callback Procedure32.14.2. Event Callback Procedure
PGEventProc # PGEventProc is a typedef for a pointer to an event procedure, that is, the user callback function that receives events from libpq. The signatu…Event Callback Procedure
Event Example32.14.4. Event Example
Here is a skeleton example of managing private data associated with libpq connections and results.
/* required header for libpq events (note: includes libpq-fe.h) */ #…Event Example
Event Support Functions32.14.3. Event Support Functions
PQregisterEventProc # Registers an event callback procedure with libpq. int PQregisterEventProc(PGconn *conn, PGEventProc proc, const char *name, void *passT…Event Support Functions
Event System32.14. Event System
libpq's event system is designed to notify registered event handlers about interesting libpq events, such as the creation or destruction of PGconn and PGresult objects. A…Event System
Event Trigger Functions9.30. Event Trigger Functions
PostgreSQL provides these helper functions to retrieve information from event triggers.
For more information about event triggers, see Chapter 38.Event Trigger Functions
Event Trigger Functions in PL/Tcl42.7. Event Trigger Functions in PL/Tcl
Event trigger functions can be written in PL/Tcl. PostgreSQL requires that a function that is to be called as an event trigger must be declared as a f…Event Trigger Functions in PL/Tcl
Event TriggersChapter 38. Event Triggers
To supplement the trigger mechanism discussed in Chapter 37, PostgreSQL also provides event triggers. Unlike regular triggers, which are attached to a single table…Event Triggers
Event Triggers in Aborted Transactions38.1.6. Event Triggers in Aborted Transactions
Event triggers (like other functions) cannot be executed in an aborted transaction. Thus, if a DDL command fails with an error, any associated …Event Triggers in Aborted Transactions
Event Types32.14.1. Event Types
The enum PGEventId names the types of events handled by the event system. All its values have names beginning with PGEVT. For each event type, there is a corresponding e…Event Types
Examining Index Usage11.12. Examining Index Usage
Although indexes in PostgreSQL do not need maintenance or tuning, it is still important to check which indexes are actually used by the real-life query workload.…Examining Index Usage
ExampleExample
To reproduce the build configuration of the current PostgreSQL installation, run the following command:
eval ./configure `pg_config --configure`
The output of pg_config --configure c…Example
ExampleF.3.2. Example
postgres=# LOAD 'auto_explain'; postgres=# SET auto_explain.log_min_duration = 0; postgres=# SET auto_explain.log_analyze = true; postgres=# SELECT count(*) FROM pg_class, pg_…Example
Example5.12.2.1. Example
Suppose we are constructing a database for a large ice cream company. The company measures peak temperatures every day as well as ice cream sales in each region. Conceptual…Example
Example5.12.3.1. Example
This example builds a partitioning structure equivalent to the declarative partitioning example above. Use the following steps:
Create the “root” table, from which all of t…Example
ExampleF.19.3. Example
-- a message can be in one or more “sections” CREATE TABLE message (mid INT PRIMARY KEY, sections INT[], ...); -- create specialized index with signature length of 32 bytes C…Example
ExampleF.22.4. Example
This example uses the following data (also available in file contrib/ltree/ltreetest.sql in the source distribution):
CREATE TABLE test (path ltree); INSERT INTO test VALUES …Example
Example Program33.5. Example Program
Example 33.1 is a sample program which shows how the large object interface in libpq can be used. Parts of the program are commented out but are left in the source for …Example Program
Example Programs32.23. Example Programs
These examples and others can be found in the directory src/test/examples in the source code distribution.
Example 32.1. libpq Example Program 1 /* * src/test/example…Example Programs
Example UsageF.7.1. Example Usage
CREATE TABLE test (a int4); -- create index CREATE INDEX testidx ON test USING GIN (a); -- query SELECT * FROM test WHERE a < 10;Example Usage
Example UsageF.8.1. Example Usage
Simple example using btree_gist instead of btree:
CREATE TABLE test (a int4); -- create index CREATE INDEX testidx ON test USING GIST (a); -- query SELECT * FROM test WH…Example Usage
ExamplesExamples
To cluster the database test:
$ clusterdb test
To cluster a single table foo in a database named xyzzy:
$ clusterdb --table=foo xyzzyExamples
ExamplesExamples
To create the database demo using the default database server:
$ createdb demo
To create the database demo using the server on host eden, port 5000, using the template0 template dat…Examples
ExamplesExamples
To create a user joe on the default database server:
$ createuser joe
To create a user joe on the default database server with prompting for some additional attributes:
$ createuser…Examples
ExamplesExamples
To destroy the database demo on the default database server:
$ dropdb demo
To destroy the database demo using the server on host eden, port 5000, with verification and a peek at the…Examples
ExamplesExamples
To remove user joe from the default database server:
$ dropuser joe
To remove user joe using the server on host eden, port 5000, with verification and a peek at the underlying comma…Examples
More results
Find definitions in the PostgreSQL manuals, reference library, and extension catalogue.
pg17: choose a version ex: extensions only ↑↓ select ↵ open