System Information Functions

Session Information Functions

Access Privilege Inquiry Functions

Schema Visibility Inquiry Functions

Each function performs the visibility check for one type of database object. For functions and operators, an object in the search path is visible if there is no object of the same name and argument data type(s) earlier in the path. For operator classes, both name and associated index access method are considered.

All these functions require OIDs to identify the objects to be checked. If you want to test an object by name, it is convenient to use the OID alias types (regclass, regtype, regprocedure, regoperator, regconfig, or regdictionary).

For example, a table is said to be visible if its containing schema is in the search path and no table of the same name appears earlier in the search path. This is equivalent to the statement that the table can be referenced by name without explicit schema qualification. For example, to list the names of all visible tables:

1
SELECT relname FROM pg_class WHERE pg_table_is_visible(oid);

System Catalog Information Functions

Comment Information Functions

Transaction IDs and Snapshots

The following functions provide server transaction information in an exportable form. The main use of these functions is to determine which transactions were committed between two snapshots.

The internal transaction ID type (xid) is 32 bits wide and wraps around every 4 billion transactions. txid_snapshot, the data type used by these functions, stores information about transaction ID visibility at a particular moment in time. Table 1 describes its components.

Table 1 Snapshot components

Name

Description

xmin

Earliest transaction ID (txid) that is still active. All earlier transactions will either be committed and visible, or rolled back.

xmax

First as-yet-unassigned txid. All txids greater than or equal to this are not yet started as of the time of the snapshot, so they are invisible.

xip_list

Active txids at the time of the snapshot. The list includes only those active txids between xmin and xmax; there might be active txids higher than xmax. A txid that is xmin <= txid < xmax and not in this list was already completed at the time of the snapshot, and is either visible or dead according to its commit status. The list does not include txids of subtransactions.

txid_snapshot's textual representation is xmin:xmax:xip_list.

For example: 10:20:10,14,15 means xmin=10, xmax=20, xip_list=10, 14, 15.

Computing Node Group Function

pv_compute_pool_workload()

Description: Load status of a computing Node Group.

Return type: void

For example:

1
2
3
4
5
6
SELECT * from pv_compute_pool_workload();
 nodename  | rpinuse | maxrp | nodestate
-----------+---------+-------+-----------
 datanode1 |       0 |  1000 | normal
 datanode2 |       0 |  1000 | normal
(2 rows)

Lock Information Function

pgxc_get_lock_conflicts()

Description: Obtains information about conflicting locks in the cluster. When a lock is waiting for another lock or another lock is waiting for it, a lock conflict occurs.

Return type: setof record