Dmitigr Pgfe  1.1beta
The modern C++ API to PostgreSQL
Public Member Functions | List of all members
Problem Class Referenceabstract

Represents the problem which occurred on the PostgreSQL server. More...

#include <dmitigr/pgfe/problem.hpp>

Inheritance diagram for Problem:
Error Notice

Public Member Functions

virtual ~Problem ()=default
 The destructor. More...
 
virtual std::error_code code () const =0
 
virtual Problem_severity severity () const =0
 
virtual const std::string & severity_localized () const noexcept=0
 
virtual const std::string & severity_non_localized () const =0
 
virtual const std::string & sqlstate () const noexcept=0
 
virtual const std::string & brief () const noexcept=0
 
virtual const std::optional< std::string > & detail () const noexcept=0
 
virtual const std::optional< std::string > & hint () const noexcept=0
 
virtual const std::optional< std::string > & query_position () const noexcept=0
 
virtual const std::optional< std::string > & internal_query_position () const noexcept=0
 
virtual const std::optional< std::string > & internal_query () const noexcept=0
 
virtual const std::optional< std::string > & context () const noexcept=0
 
virtual const std::optional< std::string > & schema_name () const noexcept=0
 
virtual const std::optional< std::string > & table_name () const noexcept=0
 
virtual const std::optional< std::string > & column_name () const noexcept=0
 
virtual const std::optional< std::string > & data_type_name () const noexcept=0
 
virtual const std::optional< std::string > & constraint_name () const noexcept=0
 
virtual const std::optional< std::string > & source_file () const noexcept=0
 
virtual const std::optional< std::string > & source_line () const noexcept=0
 
virtual const std::optional< std::string > & source_function () const noexcept=0
 

Detailed Description

Represents the problem which occurred on the PostgreSQL server.

Constructor & Destructor Documentation

◆ ~Problem()

virtual ~Problem ( )
virtualdefault

The destructor.

Member Function Documentation

◆ brief()

virtual const std::string& brief ( ) const
pure virtualnoexcept
Returns
The brief human-readable description.
Remarks
Typically, one line.

◆ code()

virtual std::error_code code ( ) const
pure virtual
Returns
The object with the corresponding PostgreSQL error code.

◆ column_name()

virtual const std::optional<std::string>& column_name ( ) const
pure virtualnoexcept
Returns
The name of the table column, associated with the problem.
Remarks
Refer to schema_name() and table_name() to identity the table.

◆ constraint_name()

virtual const std::optional<std::string>& constraint_name ( ) const
pure virtualnoexcept
Returns
The name of the constraint, associated with the problem.
Remarks
Indexes are treated as constraints, even if they weren't created with constraint syntax.

◆ context()

virtual const std::optional<std::string>& context ( ) const
pure virtualnoexcept
Returns
The indication of the context in which the problem occurred.

Presently this includes a call stack traceback of active procedural language functions and internally-generated queries.

Remarks
The trace is one entry per line, most recent first.

◆ data_type_name()

virtual const std::optional<std::string>& data_type_name ( ) const
pure virtualnoexcept
Returns
The name of the data type, associated with the problem.
Remarks
Refer to schema_name() for the name of the data type's schema.

◆ detail()

virtual const std::optional<std::string>& detail ( ) const
pure virtualnoexcept
Returns
The optional message carrying more detail about the problem.
Remarks
Might consist to multiple lines. Newline characters should be treated as paragraph breaks, not line breaks.

◆ hint()

virtual const std::optional<std::string>& hint ( ) const
pure virtualnoexcept
Returns
The optional suggestion what to do about the problem.

This is intended to differ from the result of detail() in that it offers advice (potentially inappropriate) rather than hard facts.

Remarks
Might consist to multiple lines. Newline characters should be treated as paragraph breaks, not line breaks.

◆ internal_query()

virtual const std::optional<std::string>& internal_query ( ) const
pure virtualnoexcept
Returns
The text of the failed internally-generated query.
Remarks
This could be, for example, a SQL query issued by a PL/pgSQL function.

◆ internal_query_position()

virtual const std::optional<std::string>& internal_query_position ( ) const
pure virtualnoexcept
Returns
: Similar to query_position(), but it is used when the position refers to an internally-generated query rather than the one submitted by the client.

◆ query_position()

virtual const std::optional<std::string>& query_position ( ) const
pure virtualnoexcept
Returns
The position of a character of the query string submitted by client.
Remarks
Positions start at 1 and measured in characters rather than bytes!

◆ schema_name()

virtual const std::optional<std::string>& schema_name ( ) const
pure virtualnoexcept
Returns
The name of schema, associated with the problem.

◆ severity()

virtual Problem_severity severity ( ) const
pure virtual
Returns
The value of enum class that corresponds to the problem severity.
Exceptions
<tt>std::runtime_error</tt>if used with version of PostgreSQL prior to 9.6.
See also
severity_localized(), severity_non_localized()

◆ severity_localized()

virtual const std::string& severity_localized ( ) const
pure virtualnoexcept

Similar to severity_non_localized(), but textual representation possibly localized.

See also
severity(), severity_non_localized()

◆ severity_non_localized()

virtual const std::string& severity_non_localized ( ) const
pure virtual
Returns
The textual representation of the problem severity, which can be one of the following: "LOG", "INFO", "DEBUG", "NOTICE", "WARNING", or "ERROR", "FATAL", "PANIC".
Exceptions
<tt>std::runtime_error</tt>if used with version of PostgreSQL prior to 9.6.
See also
severity(), severity_localized()

◆ source_file()

virtual const std::optional<std::string>& source_file ( ) const
pure virtualnoexcept
Returns
The file name of the source-code location where the problem was reported.

◆ source_function()

virtual const std::optional<std::string>& source_function ( ) const
pure virtualnoexcept
Returns
The name of the source-code routine reporting the problem.

◆ source_line()

virtual const std::optional<std::string>& source_line ( ) const
pure virtualnoexcept
Returns
The line number of the source-code location where the problem was reported.

◆ sqlstate()

virtual const std::string& sqlstate ( ) const
pure virtualnoexcept
Returns
The SQLSTATE code of the problem.

◆ table_name()

virtual const std::optional<std::string>& table_name ( ) const
pure virtualnoexcept
Returns
The name of table, associated with the problem.
Remarks
Refer to schema_name() for the name of the table's schema.

The documentation for this class was generated from the following file: