# Poco::Data::PostgreSQL

# class PostgreSQLException

Library: Data/PostgreSQL
Package: PostgreSQL
Header: Poco/Data/PostgreSQL/PostgreSQLException.h

## Description

Base class for all PostgreSQL exceptions

## Inheritance

Direct Base Classes: Poco::Data::DataException

All Base Classes: Poco::Data::DataException, Poco::Exception, Poco::IOException, Poco::RuntimeException, std::exception

Known Derived Classes: ConnectionException, TransactionException, StatementException

## Member Summary

Member Functions: className, clone, name, operator =, rethrow, sqlState

Inherited Functions: className, clone, code, displayText, extendedMessage, message, name, nested, operator =, rethrow, what

## Constructors

### PostgreSQLException

explicit PostgreSQLException(
const std::string & aMessage
);

Creates PostgreSQLException.

### PostgreSQLException

PostgreSQLException(
const PostgreSQLException & exc
);

Creates PostgreSQLException.

### PostgreSQLException

explicit PostgreSQLException(
const std::string & aMessage,
const char * pAnSqlState
);

Creates PostgreSQLException.

## Destructor

### ~PostgreSQLException

~PostgreSQLException() noexcept;

Destroys PostgreSQLexception.

## Member Functions

### className

const char * className() const noexcept;

Returns the name of the exception class.

See also: Poco::Data::DataException::className()

### clone

Poco::Exception * clone() const;

Creates an exact copy of the exception.

The copy can later be thrown again by invoking rethrow() on it.

### name

const char * name() const noexcept;

Returns exception name.

See also: Poco::Data::DataException::name()

### operator =

PostgreSQLException & operator = (
const PostgreSQLException & exc
);

Assignment operator.

### rethrow

void rethrow() const;

(Re)Throws the exception.

This is useful for temporarily storing a copy of an exception (see clone()), then throwing it again.

See also: Poco::Data::DataException::rethrow()

### sqlState

const char * sqlState() const noexcept;

Returns the SqlState