Monitoring a Greenplum System

You can monitor a Greenplum Database system using a variety of tools included with the system or available as add-ons. SNMP support allows Greenplum to be integrated with popular system management frameworks.

Observing the Greenplum Database system day-to-day performance helps administrators understand the system behavior, plan workflow, and troubleshoot problems. This chapter discusses tools for monitoring database performance and activity.

Also, be sure to review Recommended Monitoring and Maintenance Tasks for monitoring activities you can script to quickly detect problems in the system.

Parent topic: Managing a Greenplum System

Monitoring Database Activity and Performance

Greenplum Database includes an optional system monitoring and management database, gpperfmon, that administrators can enable. The gpperfmon_install command-line utility creates the gpperfmon database and enables data collection agents that collect and store query and system metrics in the database. Administrators can query metrics in the gpperfmon database. See the documentation for the gpperfmon database in the Greenplum Database Reference Guide.

Tanzu Greenplum Command Center, an optional web-based interface, graphically displays the metrics collected in the gpperfmon database and provides additional system management tools. Download the Greenplum Command Center package from VMware Tanzu Network and view the documentation at the Greenplum Command Center Documentation web site.

Monitoring System State

As a Greenplum Database administrator, you must monitor the system for problem events such as a segment going down or running out of disk space on a segment host. The following topics describe how to monitor the health of a Greenplum Database system and examine certain state information for a Greenplum Database system.

Enabling System Alerts and Notifications

You can configure a Greenplum Database system to trigger SNMP (Simple Network Management Protocol) alerts or send email notifications to system administrators if certain database events occur. These events include:

  • All PANIC-level error conditions
  • All FATAL-level error conditions
  • ERROR-level conditions that are “internal errors” (for example, SIGSEGV errors)
  • Database system shutdown and restart
  • Segment failure and recovery
  • Standby master out-of-sync conditions
  • Master host manual shutdown or other software problem (in certain failure scenarios, Greenplum Database cannot send an alert or notification)

This topic includes the following sub-topics:

Note that SNMP alerts and email notifications report the same event information. There is no difference in the event information that either tool reports. For information about the SNMP event information, see Greenplum Database SNMP OIDs and Error Codes.

Using SNMP with a Greenplum Database System

Greenplum Database supports SNMP to monitor the state of a Greenplum Database system using MIBs (Management Information Bases). MIBs are collections of objects that describe an SNMP-manageable entity — in this case, a Greenplum Database system.

The Greenplum Database SNMP support allows a Network Management System to obtain information about the hardware, operating system, and Greenplum Database from the same port (161) and IP address. It also enables the auto-discovery of Greenplum Database instances.

Prerequisites

Before setting up SNMP support on Greenplum Database, ensure SNMP is installed on the master host. If the snmpd file is not present in the /usr/sbin directory, then SNMP is not installed on the system. Depending on the platform on which you are running Greenplum Database, install the following:

Operating SystemPackages1
Red Hat Enterprisenet-snmp

net-snmp-libs

net-snmp-utils
CentOSnet-snmp
SUSEN/A

1 SNMP is installed by default on SUSE platforms.

The snmp.conf configuration file is located in /etc/snmp/.

Pre-installation Tasks

After you establish that SNMP is on the master host, log in as root, open a text editor, and edit the path\_to/snmp/snmpd.conf file. To use SNMP with Greenplum Database, the minimum configuration change required to the snmpd.conf file is specifying a community name. For example:

  1. rocommunity public

Note: Replace public with the name of your SNMP community. You should also configure syslocation and syscontact. Configure other SNMP settings as required for your environment and save the file.

For more information about the snmpd.conf file, enter:

  1. man snmpd.conf

Note: On SUSE Linux platforms, make sure to review and configure security settings in the snmp.conf file so snmpd accepts connections from sub-agents and returns all available Object IDs (OIDs).

After you finish configuring the snmpd.conf file, start the system snmpd daemon:

  1. # /sbin/chkconfig snmpd on

Then, verify the system snmpd daemon is running. Enter:

  1. # snmpwalk -v 1 -c <community_name> localhost .1.3.6.1.2.1.1.1.0

For example:

  1. # snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.1.1.0

If this command returns “Timeout: No Response from localhost“, then the system snmpd daemon is not running. If the daemon is running, output similar to the following displays:

  1. SNMPv2-MIB::sysDescr.0 = STRING: Linux *hostname*
  2. 2.6.18-92.el5 #1 SMP Tue Jun 10 18:51:06 EDT 2016 x86_64
Setting up SNMP Notifications
  1. To configure a Greenplum Database system to send SNMP notifications when alerts occur, set the following parameters on the Greenplum Database master host with the gpconfig utility:

    • gp_snmp_community: Set this parameter to the community name you specified for your environment.

    • gp_snmp_monitor_address: Enter the hostname:port of your network monitor application. Typically, the port number is 162. If there are multiple monitor addresses, separate them with a comma.

    • gp_snmp_use_inform_or_trap: Enter either trap or inform. Trap notifications are SNMP messages sent from one application to another (for example, between Greenplum Database and a network monitoring application). These messages are unacknowledged by the monitoring application, but generate less network overhead.

      Inform notifications are the same as trap messages, except the application sends an acknowledgement to the application that generated the alert. In this case, the monitoring application sends acknowledgement messages to Greenplum Database-generated trap notifications. While inform messages create more overhead, they inform Greenplum Database the monitoring application has received the traps.

      The following example commands set the server configuration parameters with the Greenplum Database gpconfig utility:

      1. $ gpconfig -c gp_snmp_community -v public --masteronly
      2. $ gpconfig -c gp_snmp_monitor_address -v mdw:162 --masteronly
      3. $ gpconfig -c gp_snmp_use_inform_or_trap -v trap --masteronly
  2. To test SNMP notifications, you can use the snmptrapd trap receiver. As root, enter:

    1. # /usr/sbin/snmptrapd -m ALL -Lf ~/<filename>.log

    -Lf indicates that traps are logged to a file. -Le indicates that traps are logged to stderr instead. -m ALL loads all available MIBs (you can also specify individual MIBs if required).

Enabling Email Notifications

Complete the following steps to enable Greenplum Database to send email notifications to system administrators whenever certain database events occur.

  1. Open $MASTER_DATA_DIRECTORY/postgresql.conf in a text editor.

  2. In the EMAIL ALERTS section, uncomment the following parameters and enter the appropriate values for your email server and domain. For example:

    1. gp_email_smtp_server='smtp.company.com:25'
    2. gp_email_smtp_userid='gpadmin@example.com'
    3. gp_email_smtp_password='mypassword'
    4. gp_email_from='Greenplum Database <gpadmin@example.com>'
    5. gp_email_to='dba@example.com;John Smith <jsmith@example.com>'

    You may create specific email accounts or groups in your email system that send and receive email alerts from the Greenplum Database system. For example:

    1. gp_email_from='GPDB Production Instance <gpdb@example.com>'
    2. gp_email_to='gpdb_dba_group@example.com'

    You can also specify multiple email addresses for both gp_email parameters. Use a semi-colon ( ; ) to separate each email address. For example:

    1. gp_email_to='gpdb_dba_group@example.com;admin@example.com'
  3. Save and close the postgresql.conf file.

  4. Reload the Greenplum Database postgresql.conf file:

    1. $ gpstop -u

Testing Email Notifications

The Greenplum Database master host must be able to connect to the SMTP email server you specify for the gp_email_smtp_server parameter. To test connectivity, use the ping command:

  1. $ ping <<my_email_server>>

If the master host can contact the SMTP server, run this psql command to log into a database and test email notification with the gp_elog function:

  1. $ psql -d <<testdb>> -U gpadmin -c "SELECT gp_elog('Test GPDB Email',true);"

The address you specified for the gp_email_to parameter should receive an email with Test GPDB Email in the subject line.

Note: If you have difficulty sending and receiving email notifications, verify the security settings for you organization’s email server and firewall.

Checking System State

A Greenplum Database system is comprised of multiple PostgreSQL instances (the master and segments) spanning multiple machines. To monitor a Greenplum Database system, you need to know information about the system as a whole, as well as status information of the individual instances. The gpstate utility provides status information about a Greenplum Database system.

Viewing Master and Segment Status and Configuration

The default gpstate action is to check segment instances and show a brief status of the valid and failed segments. For example, to see a quick status of your Greenplum Database system:

  1. $ gpstate

To see more detailed information about your Greenplum Database array configuration, use gpstate with the -s option:

  1. $ gpstate -s

Viewing Your Mirroring Configuration and Status

If you are using mirroring for data redundancy, you may want to see the list of mirror segment instances in the system, their current synchronization status, and the mirror to primary mapping. For example, to see the mirror segments in the system and their status:

  1. $ gpstate -m

To see the primary to mirror segment mappings:

  1. $ gpstate -c

To see the status of the standby master mirror:

  1. $ gpstate -f

Checking Disk Space Usage

A database administrator’s most important monitoring task is to make sure the file systems where the master and segment data directories reside do not grow to more than 70 percent full. A filled data disk will not result in data corruption, but it may prevent normal database activity from continuing. If the disk grows too full, it can cause the database server to shut down.

You can use the gp_disk_free external table in the gp_toolkit administrative schema to check for remaining free space (in kilobytes) on the segment host file systems. For example:

  1. =# SELECT * FROM gp_toolkit.gp_disk_free
  2. ORDER BY dfsegment;

Checking Sizing of Distributed Databases and Tables

The gp_toolkit administrative schema contains several views that you can use to determine the disk space usage for a distributed Greenplum Database database, schema, table, or index.

For a list of the available sizing views for checking database object sizes and disk space, see the Greenplum Database Reference Guide.

Viewing Disk Space Usage for a Database

To see the total size of a database (in bytes), use the gp_size_of_database view in the gp_toolkit administrative schema. For example:

  1. => SELECT * FROM gp_toolkit.gp_size_of_database
  2. ORDER BY sodddatname;
Viewing Disk Space Usage for a Table

The gp_toolkit administrative schema contains several views for checking the size of a table. The table sizing views list the table by object ID (not by name). To check the size of a table by name, you must look up the relation name (relname) in the pg_class table. For example:

  1. => SELECT relname AS name, sotdsize AS size, sotdtoastsize
  2. AS toast, sotdadditionalsize AS other
  3. FROM gp_toolkit.gp_size_of_table_disk as sotd, pg_class
  4. WHERE sotd.sotdoid=pg_class.oid ORDER BY relname;

For a list of the available table sizing views, see the Greenplum Database Reference Guide.

Viewing Disk Space Usage for Indexes

The gp_toolkit administrative schema contains a number of views for checking index sizes. To see the total size of all index(es) on a table, use the gp_size_of_all_table_indexes view. To see the size of a particular index, use the gp_size_of_index view. The index sizing views list tables and indexes by object ID (not by name). To check the size of an index by name, you must look up the relation name (relname) in the pg_class table. For example:

  1. => SELECT soisize, relname as indexname
  2. FROM pg_class, gp_toolkit.gp_size_of_index
  3. WHERE pg_class.oid=gp_size_of_index.soioid
  4. AND pg_class.relkind='i';

Checking for Data Distribution Skew

All tables in Greenplum Database are distributed, meaning their data is divided evenly across all of the segments in the system. Unevenly distributed data may diminish query processing performance. A table’s distribution policy is determined at table creation time. For information about choosing the table distribution policy, see the following topics:

The gp_toolkit administrative schema also contains a number of views for checking data distribution skew on a table. For information about how to check for uneven data distribution, see the Greenplum Database Reference Guide.

Viewing a Table’s Distribution Key

To see the columns used as the data distribution key for a table, you can use the \d+ meta-command in psql to examine the definition of a table. For example:

  1. =# `\d+ sales
  2. ` Table "retail.sales"
  3. Column | Type | Modifiers | Description
  4. -------------+--------------+-----------+-------------
  5. sale_id | integer | |
  6. amt | float | |
  7. date | date | |
  8. Has OIDs: no
  9. Distributed by: (sale_id)

Viewing Data Distribution

To see the data distribution of a table’s rows (the number of rows on each segment), you can run a query such as:

  1. =# SELECT gp_segment_id, count(*)
  2. FROM <table_name> GROUP BY gp_segment_id;

A table is considered to have a balanced distribution if all segments have roughly the same number of rows.

Checking for Query Processing Skew

When a query is being processed, all segments should have equal workloads to ensure the best possible performance. If you identify a poorly-performing query, you may need to investigate further using the EXPLAIN command. For information about using the EXPLAIN command and query profiling, see Query Profiling.

Query processing workload can be skewed if the table’s data distribution policy and the query predicates are not well matched. To check for processing skew, you can run a query such as:

  1. =# SELECT gp_segment_id, count(*) FROM <table_name>
  2. WHERE <column>='<value>' GROUP BY gp_segment_id;

This will show the number of rows returned by segment for the given WHERE predicate.

Avoiding an Extreme Skew Warning

You may receive the following warning message while executing a query that performs a hash join operation:

Extreme skew in the innerside of Hashjoin

This occurs when the input to a hash join operator is skewed. It does not prevent the query from completing successfully. You can follow these steps to avoid skew in the plan:

  1. Ensure that all fact tables are analyzed.
  2. Verify that any populated temporary table used by the query is analyzed.
  3. View the EXPLAIN ANALYZE plan for the query and look for the following:
    • If there are scans with multi-column filters that are producing more rows than estimated, then set the gp_selectivity_damping_factor server configuration parameter to 2 or higher and retest the query.
    • If the skew occurs while joining a single fact table that is relatively small (less than 5000 rows), set the gp_segments_for_planner server configuration parameter to 1 and retest the query.
  4. Check whether the filters applied in the query match distribution keys of the base tables. If the filters and distribution keys are the same, consider redistributing some of the base tables with different distribution keys.
  5. Check the cardinality of the join keys. If they have low cardinality, try to rewrite the query with different joining columns or or additional filters on the tables to reduce the number of rows. These changes could change the query semantics.

Viewing Metadata Information about Database Objects

Greenplum Database tracks various metadata information in its system catalogs about the objects stored in a database, such as tables, views, indexes and so on, as well as global objects such as roles and tablespaces.

Viewing the Last Operation Performed

You can use the system views pg_stat_operations and pg_stat_partition_operations to look up actions performed on an object, such as a table. For example, to see the actions performed on a table, such as when it was created and when it was last vacuumed and analyzed:

  1. => SELECT schemaname as schema, objname as table,
  2. usename as role, actionname as action,
  3. subtype as type, statime as time
  4. FROM pg_stat_operations
  5. WHERE objname='cust';
  6. schema | table | role | action | type | time
  7. --------+-------+------+---------+-------+--------------------------
  8. sales | cust | main | CREATE | TABLE | 2016-02-09 18:10:07.867977-08
  9. sales | cust | main | VACUUM | | 2016-02-10 13:32:39.068219-08
  10. sales | cust | main | ANALYZE | | 2016-02-25 16:07:01.157168-08
  11. (3 rows)

Viewing the Definition of an Object

To see the definition of an object, such as a table or view, you can use the \d+ meta-command when working in psql. For example, to see the definition of a table:

  1. => \d+ <mytable>

Viewing Session Memory Usage Information

You can create and use the session_level_memory_consumption view that provides information about the current memory utilization for sessions that are running queries on Greenplum Database. The view contains session information and information such as the database that the session is connected to, the query that the session is currently running, and memory consumed by the session processes.

Creating the session_level_memory_consumption View

To create the session_level_memory_consumption view in a Greenplum Database, run the script $GPHOME/share/postgresql/contrib/gp_session_state.sql once for each database. For example, to install the view in the database testdb, use this command:

  1. $ psql -d testdb -f $GPHOME/share/postgresql/contrib/gp_session_state.sql

The session_level_memory_consumption View

The session_level_memory_consumption view provides information about memory consumption and idle time for sessions that are running SQL queries.

When resource queue-based resource management is active, the column is_runaway indicates whether Greenplum Database considers the session a runaway session based on the vmem memory consumption of the session’s queries. Under the resource queue-based resource management scheme, Greenplum Database considers the session a runaway when the queries consume an excessive amount of memory. The Greenplum Database server configuration parameter runaway_detector_activation_percent governs the conditions under which Greenplum Database considers a session a runaway session.

The is_runaway, runaway_vmem_mb, and runaway_command_cnt columns are not applicable when resource group-based resource management is active.

columntypereferencesdescription
datnamename Name of the database that the session is connected to.
sess_idinteger Session ID.
usenamename Name of the session user.
current_querytext Current SQL query that the session is running.
segidinteger Segment ID.
vmem_mbinteger Total vmem memory usage for the session in MB.
is_runawayboolean Session is marked as runaway on the segment.
qe_countinteger Number of query processes for the session.
active_qe_countinteger Number of active query processes for the session.
dirty_qe_countinteger Number of query processes that have not yet released their memory.The value is -1 for sessions that are not running.
runaway_vmem_mbinteger Amount of vmem memory that the session was consuming when it was marked as a runaway session.
runaway_command_cntinteger Command count for the session when it was marked as a runaway session.
idle_starttimestamptz The last time a query process in this session became idle.

Viewing Query Workfile Usage Information

The Greenplum Database administrative schema gp_toolkit contains views that display information about Greenplum Database workfiles. Greenplum Database creates workfiles on disk if it does not have sufficient memory to execute the query in memory. This information can be used for troubleshooting and tuning queries. The information in the views can also be used to specify the values for the Greenplum Database configuration parameters gp_workfile_limit_per_query and gp_workfile_limit_per_segment.

These are the views in the schema gp_toolkit:

  • The gp_workfile_entries view contains one row for each operator using disk space for workfiles on a segment at the current time.
  • The gp_workfile_usage_per_query view contains one row for each query using disk space for workfiles on a segment at the current time.
  • The gp_workfile_usage_per_segment view contains one row for each segment. Each row displays the total amount of disk space used for workfiles on the segment at the current time.

For information about using gp_toolkit, see Using gp_toolkit.

Viewing the Database Server Log Files

Every database instance in Greenplum Database (master and segments) runs a PostgreSQL database server with its own server log file. Daily log files are created in the pg_log directory of the master and each segment data directory.

Log File Format

The server log files are written in comma-separated values (CSV) format. Some log entries will not have values for all log fields. For example, only log entries associated with a query worker process will have the slice_id populated. You can identify related log entries of a particular query by the query’s session identifier (gp_session_id) and command identifier (gp_command_count).

The following fields are written to the log:

#Field NameData TypeDescription
1event_timetimestamp with time zoneTime that the log entry was written to the log
2user_namevarchar(100)The database user name
3database_namevarchar(100)The database name
4process_idvarchar(10)The system process ID (prefixed with “p”)
5thread_idvarchar(50)The thread count (prefixed with “th”)
6remote_hostvarchar(100)On the master, the hostname/address of the client machine. On the segment, the hostname/address of the master.
7remote_portvarchar(10)The segment or master port number
8session_start_timetimestamp with time zoneTime session connection was opened
9transaction_idintTop-level transaction ID on the master. This ID is the parent of any subtransactions.
10gp_session_idtextSession identifier number (prefixed with “con”)
11gp_command_counttextThe command number within a session (prefixed with “cmd”)
12gp_segmenttextThe segment content identifier (prefixed with “seg” for primaries or “mir” for mirrors). The master always has a content ID of -1.
13slice_idtextThe slice ID (portion of the query plan being executed)
14distr_tranx_idtextDistributed transaction ID
15local_tranx_idtextLocal transaction ID
16sub_tranx_idtextSubtransaction ID
17event_severityvarchar(10)Values include: LOG, ERROR, FATAL, PANIC, DEBUG1, DEBUG2
18sql_state_codevarchar(10)SQL state code associated with the log message
19event_messagetextLog or error message text
20event_detailtextDetail message text associated with an error or warning message
21event_hinttextHint message text associated with an error or warning message
22internal_querytextThe internally-generated query text
23internal_query_posintThe cursor index into the internally-generated query text
24event_contexttextThe context in which this message gets generated
25debug_query_stringtextUser-supplied query string with full detail for debugging. This string can be modified for internal use.
26error_cursor_posintThe cursor index into the query string
27func_nametextThe function in which this message is generated
28file_nametextThe internal code file where the message originated
29file_lineintThe line of the code file where the message originated
30stack_tracetextStack trace text associated with this message

Searching the Greenplum Server Log Files

Greenplum Database provides a utility called gplogfilter can search through a Greenplum Database log file for entries matching the specified criteria. By default, this utility searches through the Greenplum Database master log file in the default logging location. For example, to display the last three lines of each of the log files under the master directory:

  1. $ gplogfilter -n 3

To search through all segment log files simultaneously, run gplogfilter through the gpssh utility. For example, to display the last three lines of each segment log file:

  1. $ gpssh -f seg_host_file
  1. => source /usr/local/greenplum-db/greenplum_path.sh
  2. => gplogfilter -n 3 /gpdata/gp*/pg_log/gpdb*.log

Using gp_toolkit

Use the Greenplum Database administrative schema gp_toolkit to query the system catalogs, log files, and operating environment for system status information. The gp_toolkit schema contains several views you can access using SQL commands. The gp_toolkit schema is accessible to all database users. Some objects require superuser permissions. Use a command similar to the following to add the gp_toolkit schema to your schema search path:

  1. => ALTER ROLE myrole SET search_path TO myschema,gp_toolkit;

For a description of the available administrative schema views and their usages, see the Greenplum Database Reference Guide.

Greenplum Database SNMP OIDs and Error Codes

When a Greenplum Database system is configured to trigger SNMP alerts or send email notifications to system administrators if certain database events occur, the alerts and notifications containObject IDs (OIDs) and SQL error codes.

For information about enabling Greenplum Database to use SNMP, see Enabling System Alerts and Notifications

Greenplum Database SNMP OIDs

This is the Greenplum Database OID hierarchy structure:

  1. iso(1)
  2. identified-organization(3)
  3. dod(6)
  4. internet(1)
  5. private(4)
  6. enterprises(1)
  7. gpdbMIB(31327)
  8. gpdbObjects(1)
  9. gpdbAlertMsg(1)

gpdbAlertMsg

  1. 1.3.6.1.4.1.31327.1.1: STRING: alert message text

gpdbAlertSeverity

  1. 1.3.6.1.4.1.31327.1.2: INTEGER: severity level
  1. gpdbAlertSeverity can have one of the following values:
  2. ```
  3. gpdbSevUnknown(0)
  4. gpdbSevOk(1)
  5. gpdbSevWarning(2)
  6. gpdbSevError(3)
  7. gpdbSevFatal(4)
  8. gpdbSevPanic(5)
  9. gpdbSevSystemDegraded(6)
  10. gpdbSevSystemDown(7)
  11. ```

gpdbAlertSqlstate

  1. 1.3.6.1.4.1.31327.1.3: STRING: SQL standard error codes
  1. For a list of codes, see SQL Standard Error Codes.

gpdbAlertDetail

  1. 1.3.6.1.4.1.31327.1.4: STRING: detailed alert message text

gpdbAlertSqlStmt

  1. 1.3.6.1.4.1.31327.1.5: STRING: SQL statement generating this alert if applicable

gpdbAlertSystemName

  1. 1.3.6.1.4.1.31327.1.6: STRING: hostname

SQL Standard Error Codes

The following table lists all the defined error codes. Some are not used, but are defined by the SQL standard. The error classes are also shown. For each error class there is a standard error code having the last three characters 000. This code is used only for error conditions that fall within the class but do not have any more-specific code assigned.

The PL/pgSQL condition name for each error code is the same as the phrase shown in the table, with underscores substituted for spaces. For example, code 22012, DIVISION BY ZERO, has condition name DIVISION_BY_ZERO. Condition names can be written in either upper or lower case.

Note: PL/pgSQL does not recognize warning, as opposed to error, condition names; those are classes 00, 01, and 02.

Error CodeMeaningConstant
Class 00— Successful Completion
00000SUCCESSFUL COMPLETIONsuccessful_completion
Class 01 — Warning
01000WARNINGwarning
0100CDYNAMIC RESULT SETS RETURNEDdynamic_result_sets_returned
01008IMPLICIT ZERO BIT PADDINGimplicit_zero_bit_padding
01003NULL VALUE ELIMINATED IN SET FUNCTIONnull_value_eliminated_in_set_function
01007PRIVILEGE NOT GRANTEDprivilege_not_granted
01006PRIVILEGE NOT REVOKEDprivilege_not_revoked
01004STRING DATA RIGHT TRUNCATIONstring_data_right_truncation
01P01DEPRECATED FEATUREdeprecated_feature
Class 02 — No Data (this is also a warning class per the SQL standard)
02000NO DATAno_data
02001NO ADDITIONAL DYNAMIC RESULT SETS RETURNEDno_additional_dynamic_result_sets_returned
Class 03 — SQL Statement Not Yet Complete
03000SQL STATEMENT NOT YET COMPLETEsql_statement_not_yet_complete
Class 08 — Connection Exception
08000CONNECTION EXCEPTIONconnection_exception
08003CONNECTION DOES NOT EXISTconnection_does_not_exist
08006CONNECTION FAILUREconnection_failure
08001SQLCLIENT UNABLE TO ESTABLISH SQLCONNECTIONsqlclient_unable_to_establish_sqlconnection
08004SQLSERVER REJECTED ESTABLISHMENT OF SQLCONNECTIONsqlserver_rejected_establishment_of_sqlconnection
08007TRANSACTION RESOLUTION UNKNOWNtransaction_resolution_unknown
08P01PROTOCOL VIOLATIONprotocol_violation
Class 09 — Triggered Action Exception
09000TRIGGERED ACTION EXCEPTIONtriggered_action_exception
Class 0A — Feature Not Supported
0A000FEATURE NOT SUPPORTEDfeature_not_supported
Class 0B — Invalid Transaction Initiation
0B000INVALID TRANSACTION INITIATIONinvalid_transaction_initiation
Class 0F — Locator Exception
0F000LOCATOR EXCEPTIONlocator_exception
0F001INVALID LOCATOR SPECIFICATIONinvalid_locator_specification
Class 0L — Invalid Grantor
0L000INVALID GRANTORinvalid_grantor
0LP01INVALID GRANT OPERATIONinvalid_grant_operation
Class 0P — Invalid Role Specification
0P000INVALID ROLE SPECIFICATIONinvalid_role_specification
Class 21 — Cardinality Violation
21000CARDINALITY VIOLATIONcardinality_violation
Class 22 — Data Exception
22000DATA EXCEPTIONdata_exception
2202EARRAY SUBSCRIPT ERRORarray_subscript_error
22021CHARACTER NOT IN REPERTOIREcharacter_not_in_repertoire
22008DATETIME FIELD OVERFLOWdatetime_field_overflow
22012DIVISION BY ZEROdivision_by_zero
22005ERROR IN ASSIGNMENTerror_in_assignment
2200BESCAPE CHARACTER CONFLICTescape_character_conflict
22022INDICATOR OVERFLOWindicator_overflow
22015INTERVAL FIELD OVERFLOWinterval_field_overflow
2201EINVALID ARGUMENT FOR LOGARITHMinvalid_argument_for_logarithm
2201FINVALID ARGUMENT FOR POWER FUNCTIONinvalid_argument_for_power_function
2201GINVALID ARGUMENT FOR WIDTH BUCKET FUNCTIONinvalid_argument_for_width_bucket_function
22018INVALID CHARACTER VALUE FOR CASTinvalid_character_value_for_cast
22007INVALID DATETIME FORMATinvalid_datetime_format
22019INVALID ESCAPE CHARACTERinvalid_escape_character
2200DINVALID ESCAPE OCTETinvalid_escape_octet
22025INVALID ESCAPE SEQUENCEinvalid_escape_sequence
22P06NONSTANDARD USE OF ESCAPE CHARACTERnonstandard_use_of_escape_character
22010INVALID INDICATOR PARAMETER VALUEinvalid_indicator_parameter_value
22020INVALID LIMIT VALUEinvalid_limit_value
22023INVALID PARAMETER VALUEinvalid_parameter_value
2201BINVALID REGULAR EXPRESSIONinvalid_regular_expression
22009INVALID TIME ZONE DISPLACEMENT VALUEinvalid_time_zone_displacement_value
2200CINVALID USE OF ESCAPE CHARACTERinvalid_use_of_escape_character
2200GMOST SPECIFIC TYPE MISMATCHmost_specific_type_mismatch
22004NULL VALUE NOT ALLOWEDnull_value_not_allowed
22002NULL VALUE NO INDICATOR PARAMETERnull_value_no_indicator_parameter
22003NUMERIC VALUE OUT OF RANGEnumeric_value_out_of_range
22026STRING DATA LENGTH MISMATCHstring_data_length_mismatch
22001STRING DATA RIGHT TRUNCATIONstring_data_right_truncation
22011SUBSTRING ERRORsubstring_error
22027TRIM ERRORtrim_error
22024UNTERMINATED C STRINGunterminated_c_string
2200FZERO LENGTH CHARACTER STRINGzero_length_character_string
22P01FLOATING POINT EXCEPTIONfloating_point_exception
22P02INVALID TEXT REPRESENTATIONinvalid_text_representation
22P03INVALID BINARY REPRESENTATIONinvalid_binary_representation
22P04BAD COPY FILE FORMATbad_copy_file_format
22P05UNTRANSLATABLE CHARACTERuntranslatable_character
Class 23 — Integrity Constraint Violation
23000INTEGRITY CONSTRAINT VIOLATIONintegrity_constraint_violation
23001RESTRICT VIOLATIONrestrict_violation
23502NOT NULL VIOLATIONnot_null_violation
23503FOREIGN KEY VIOLATIONforeign_key_violation
23505UNIQUE VIOLATIONunique_violation
23514CHECK VIOLATIONcheck_violation
Class 24 — Invalid Cursor State
24000INVALID CURSOR STATEinvalid_cursor_state
Class 25 — Invalid Transaction State
25000INVALID TRANSACTION STATEinvalid_transaction_state
25001ACTIVE SQL TRANSACTIONactive_sql_transaction
25002BRANCH TRANSACTION ALREADY ACTIVEbranch_transaction_already_active
25008HELD CURSOR REQUIRES SAME ISOLATION LEVELheld_cursor_requires_same_isolation_level
25003INAPPROPRIATE ACCESS MODE FOR BRANCH TRANSACTIONinappropriate_access_mode_for_branch_transaction
25004INAPPROPRIATE ISOLATION LEVEL FOR BRANCH TRANSACTIONinappropriate_isolation_level_for_branch_transaction
25005NO ACTIVE SQL TRANSACTION FOR BRANCH TRANSACTIONno_active_sql_transaction_for_branch_transaction
25006READ ONLY SQL TRANSACTIONread_only_sql_transaction
25007SCHEMA AND DATA STATEMENT MIXING NOT SUPPORTEDschema_and_data_statement_mixing_not_supported
25P01NO ACTIVE SQL TRANSACTIONno_active_sql_transaction
25P02IN FAILED SQL TRANSACTIONin_failed_sql_transaction
Class 26 — Invalid SQL Statement Name
26000INVALID SQL STATEMENT NAMEinvalid_sql_statement_name
Class 27 — Triggered Data Change Violation
27000TRIGGERED DATA CHANGE VIOLATIONtriggered_data_change_violation
Class 28 — Invalid Authorization Specification
28000INVALID AUTHORIZATION SPECIFICATIONinvalid_authorization_specification
Class 2B — Dependent Privilege Descriptors Still Exist
2B000DEPENDENT PRIVILEGE DESCRIPTORS STILL EXISTdependent_privilege_descriptors_still_exist
2BP01DEPENDENT OBJECTS STILL EXISTdependent_objects_still_exist
Class 2D — Invalid Transaction Termination
2D000INVALID TRANSACTION TERMINATIONinvalid_transaction_termination
Class 2F — SQL Routine Exception
2F000SQL ROUTINE EXCEPTIONsql_routine_exception
2F005FUNCTION EXECUTED NO RETURN STATEMENTfunction_executed_no_return_statement
2F002MODIFYING SQL DATA NOT PERMITTEDmodifying_sql_data_not_permitted
2F003PROHIBITED SQL STATEMENT ATTEMPTEDprohibited_sql_statement_attempted
2F004READING SQL DATA NOT PERMITTEDreading_sql_data_not_permitted
Class 34 — Invalid Cursor Name
34000INVALID CURSOR NAMEinvalid_cursor_name
Class 38 — External Routine Exception
38000EXTERNAL ROUTINE EXCEPTIONexternal_routine_exception
38001CONTAINING SQL NOT PERMITTEDcontaining_sql_not_permitted
38002MODIFYING SQL DATA NOT PERMITTEDmodifying_sql_data_not_permitted
38003PROHIBITED SQL STATEMENT ATTEMPTEDprohibited_sql_statement_attempted
38004READING SQL DATA NOT PERMITTEDreading_sql_data_not_permitted
Class 39 — External Routine Invocation Exception
39000EXTERNAL ROUTINE INVOCATION EXCEPTIONexternal_routine_invocation_exception
39001INVALID SQLSTATE RETURNEDinvalid_sqlstate_returned
39004NULL VALUE NOT ALLOWEDnull_value_not_allowed
39P01TRIGGER PROTOCOL VIOLATEDtrigger_protocol_violated
39P02SRF PROTOCOL VIOLATEDsrf_protocol_violated
Class 3B — Savepoint Exception
3B000SAVEPOINT EXCEPTIONsavepoint_exception
3B001INVALID SAVEPOINT SPECIFICATIONinvalid_savepoint_specification
Class 3D — Invalid Catalog Name
3D000INVALID CATALOG NAMEinvalid_catalog_name
Class 3F — Invalid Schema Name
3F000INVALID SCHEMA NAMEinvalid_schema_name
Class 40 — Transaction Rollback
40000TRANSACTION ROLLBACKtransaction_rollback
40002TRANSACTION INTEGRITY CONSTRAINT VIOLATIONtransaction_integrity_constraint_violation
40001SERIALIZATION FAILUREserialization_failure
40003STATEMENT COMPLETION UNKNOWNstatement_completion_unknown
40P01DEADLOCK DETECTEDdeadlock_detected
Class 42 — Syntax Error or Access Rule Violation
42000SYNTAX ERROR OR ACCESS RULE VIOLATIONsyntax_error_or_access_rule_violation
42601SYNTAX ERRORsyntax_error
42501INSUFFICIENT PRIVILEGEinsufficient_privilege
42846CANNOT COERCEcannot_coerce
42803GROUPING ERRORgrouping_error
42830INVALID FOREIGN KEYinvalid_foreign_key
42602INVALID NAMEinvalid_name
42622NAME TOO LONGname_too_long
42939RESERVED NAMEreserved_name
42804DATATYPE MISMATCHdatatype_mismatch
42P18INDETERMINATE DATATYPEindeterminate_datatype
42809WRONG OBJECT TYPEwrong_object_type
42703UNDEFINED COLUMNundefined_column
42883UNDEFINED FUNCTIONundefined_function
42P01UNDEFINED TABLEundefined_table
42P02UNDEFINED PARAMETERundefined_parameter
42704UNDEFINED OBJECTundefined_object
42701DUPLICATE COLUMNduplicate_column
42P03DUPLICATE CURSORduplicate_cursor
42P04DUPLICATE DATABASEduplicate_database
42723DUPLICATE FUNCTIONduplicate_function
42P05DUPLICATE PREPARED STATEMENTduplicate_prepared_statement
42P06DUPLICATE SCHEMAduplicate_schema
42P07DUPLICATE TABLEduplicate_table
42712DUPLICATE ALIASduplicate_alias
42710DUPLICATE OBJECTduplicate_object
42702AMBIGUOUS COLUMNambiguous_column
42725AMBIGUOUS FUNCTIONambiguous_function
42P08AMBIGUOUS PARAMETERambiguous_parameter
42P09AMBIGUOUS ALIASambiguous_alias
42P10INVALID COLUMN REFERENCEinvalid_column_reference
42611INVALID COLUMN DEFINITIONinvalid_column_definition
42P11INVALID CURSOR DEFINITIONinvalid_cursor_definition
42P12INVALID DATABASE DEFINITIONinvalid_database_definition
42P13INVALID FUNCTION DEFINITIONinvalid_function_definition
42P14INVALID PREPARED STATEMENT DEFINITIONinvalid_prepared_statement_definition
42P15INVALID SCHEMA DEFINITIONinvalid_schema_definition
42P16INVALID TABLE DEFINITIONinvalid_table_definition
42P17INVALID OBJECT DEFINITIONinvalid_object_definition
Class 44 — WITH CHECK OPTION Violation
44000WITH CHECK OPTION VIOLATIONwith_check_option_violation
Class 53 — Insufficient Resources
53000INSUFFICIENT RESOURCESinsufficient_resources
53100DISK FULLdisk_full
53200OUT OF MEMORYout_of_memory
53300TOO MANY CONNECTIONStoo_many_connections
Class 54 — Program Limit Exceeded
54000PROGRAM LIMIT EXCEEDEDprogram_limit_exceeded
54001STATEMENT TOO COMPLEXstatement_too_complex
54011TOO MANY COLUMNStoo_many_columns
54023TOO MANY ARGUMENTStoo_many_arguments
Class 55 — Object Not In Prerequisite State
55000OBJECT NOT IN PREREQUISITE STATEobject_not_in_prerequisite_state
55006OBJECT IN USEobject_in_use
55P02CANT CHANGE RUNTIME PARAMcant_change_runtime_param
55P03LOCK NOT AVAILABLElock_not_available
Class 57 — Operator Intervention
57000OPERATOR INTERVENTIONoperator_intervention
57014QUERY CANCELEDquery_canceled
57P01ADMIN SHUTDOWNadmin_shutdown
57P02CRASH SHUTDOWNcrash_shutdown
57P03CANNOT CONNECT NOWcannot_connect_now
Class 58 — System Error (errors external to Greenplum Database )
58030IO ERRORio_error
58P01UNDEFINED FILEundefined_file
58P02DUPLICATE FILEduplicate_file
Class F0 — Configuration File Error
F0000CONFIG FILE ERRORconfig_file_error
F0001LOCK FILE EXISTSlock_file_exists
Class P0 — PL/pgSQL Error
P0000PLPGSQL ERRORplpgsql_error
P0001RAISE EXCEPTIONraise_exception
P0002NO DATA FOUNDno_data_found
P0003TOO MANY ROWStoo_many_rows
Class XX — Internal Error
XX000INTERNAL ERRORinternal_error
XX001DATA CORRUPTEDdata_corrupted
XX002INDEX CORRUPTEDindex_corrupted