16#if !defined(PQXX_HEADER_PRE)
17# error "Include libpqxx headers as <pqxx/header>, not <pqxx/header.hxx>."
20#if defined(PQXX_HAVE_SOURCE_LOCATION)
21# include <source_location>
49#if defined(PQXX_HAVE_SOURCE_LOCATION)
52 std::source_location = std::source_location::current());
53 std::source_location location;
55 explicit failure(std::string
const &);
85#
if defined(PQXX_HAVE_SOURCE_LOCATION)
87 std::source_location = std::source_location::current()
106#
if defined(PQXX_HAVE_SOURCE_LOCATION)
108 std::source_location = std::source_location::current()
119#
if defined(PQXX_HAVE_SOURCE_LOCATION)
121 std::source_location = std::source_location::current()
134 std::string
const m_query;
136 std::string
const m_sqlstate;
140 std::string
const &whatarg =
"", std::string Q =
"",
142#
if defined(PQXX_HAVE_SOURCE_LOCATION)
144 std::source_location = std::source_location::current()
168#
if defined(PQXX_HAVE_SOURCE_LOCATION)
170 std::source_location = std::source_location::current()
180 std::string
const &whatarg, std::string
const &q =
"",
182#
if defined(PQXX_HAVE_SOURCE_LOCATION)
184 std::source_location = std::source_location::current()
202 std::string
const &whatarg, std::string
const &q,
204#
if defined(PQXX_HAVE_SOURCE_LOCATION)
206 std::source_location = std::source_location::current()
216 std::string
const &whatarg, std::string
const &q,
218#
if defined(PQXX_HAVE_SOURCE_LOCATION)
220 std::source_location = std::source_location::current()
230 std::string
const &whatarg, std::string
const &q,
232#
if defined(PQXX_HAVE_SOURCE_LOCATION)
234 std::source_location = std::source_location::current()
252#
if defined(PQXX_HAVE_SOURCE_LOCATION)
254 std::source_location = std::source_location::current()
258#if defined(PQXX_HAVE_SOURCE_LOCATION)
259 std::source_location location;
269#
if defined(PQXX_HAVE_SOURCE_LOCATION)
271 std::source_location = std::source_location::current()
275#if defined(PQXX_HAVE_SOURCE_LOCATION)
276 std::source_location location;
286#
if defined(PQXX_HAVE_SOURCE_LOCATION)
288 std::source_location = std::source_location::current()
292#if defined(PQXX_HAVE_SOURCE_LOCATION)
293 std::source_location location;
303#
if defined(PQXX_HAVE_SOURCE_LOCATION)
305 std::source_location = std::source_location::current()
316#
if defined(PQXX_HAVE_SOURCE_LOCATION)
318 std::source_location = std::source_location::current()
329#
if defined(PQXX_HAVE_SOURCE_LOCATION)
331 std::source_location = std::source_location::current()
335#if defined(PQXX_HAVE_SOURCE_LOCATION)
336 std::source_location location;
344#if defined(PQXX_HAVE_SOURCE_LOCATION)
346 std::string
const &msg,
347 std::source_location loc = std::source_location::current()) :
359#if defined(PQXX_HAVE_SOURCE_LOCATION)
361 std::string
const &err, std::string
const &Q =
"",
363 std::source_location loc = std::source_location::current()) :
368 std::string
const &err, std::string
const &Q =
"",
378#if defined(PQXX_HAVE_SOURCE_LOCATION)
380 std::string
const &err, std::string
const &Q =
"",
382 std::source_location loc = std::source_location::current()) :
387 std::string
const &err, std::string
const &Q =
"",
396#if defined(PQXX_HAVE_SOURCE_LOCATION)
398 std::string
const &err, std::string
const &Q =
"",
400 std::source_location loc = std::source_location::current()) :
405 std::string
const &err, std::string
const &Q =
"",
414#if defined(PQXX_HAVE_SOURCE_LOCATION)
416 std::string
const &err, std::string
const &Q =
"",
418 std::source_location loc = std::source_location::current()) :
423 std::string
const &err, std::string
const &Q =
"",
432#if defined(PQXX_HAVE_SOURCE_LOCATION)
434 std::string
const &err, std::string
const &Q =
"",
436 std::source_location loc = std::source_location::current()) :
441 std::string
const &err, std::string
const &Q =
"",
450#if defined(PQXX_HAVE_SOURCE_LOCATION)
452 std::string
const &err, std::string
const &Q =
"",
454 std::source_location loc = std::source_location::current()) :
459 std::string
const &err, std::string
const &Q =
"",
468#if defined(PQXX_HAVE_SOURCE_LOCATION)
470 std::string
const &err, std::string
const &Q =
"",
472 std::source_location loc = std::source_location::current()) :
477 std::string
const &err, std::string
const &Q =
"",
486#if defined(PQXX_HAVE_SOURCE_LOCATION)
488 std::string
const &err, std::string
const &Q =
"",
490 std::source_location loc = std::source_location::current()) :
495 std::string
const &err, std::string
const &Q =
"",
504#if defined(PQXX_HAVE_SOURCE_LOCATION)
506 std::string
const &err, std::string
const &Q =
"",
508 std::source_location loc = std::source_location::current()) :
513 std::string
const &err, std::string
const &Q =
"",
522#if defined(PQXX_HAVE_SOURCE_LOCATION)
524 std::string
const &err, std::string
const &Q =
"",
526 std::source_location loc = std::source_location::current()) :
531 std::string
const &err, std::string
const &Q =
"",
540#if defined(PQXX_HAVE_SOURCE_LOCATION)
542 std::string
const &err, std::string
const &Q =
"",
544 std::source_location loc = std::source_location::current()) :
549 std::string
const &err, std::string
const &Q =
"",
561#if defined(PQXX_HAVE_SOURCE_LOCATION)
563 std::string
const &err, std::string
const &Q =
"",
564 char const sqlstate[] =
nullptr,
int pos = -1,
565 std::source_location loc = std::source_location::current()) :
570 std::string
const &err, std::string
const &Q =
"",
571 char const sqlstate[] =
nullptr,
int pos = -1) :
579#if defined(PQXX_HAVE_SOURCE_LOCATION)
581 std::string
const &err, std::string
const &Q =
"",
583 std::source_location loc = std::source_location::current()) :
589 std::string
const &err, std::string
const &Q =
"",
598#if defined(PQXX_HAVE_SOURCE_LOCATION)
600 std::string
const &err, std::string
const &Q =
"",
602 std::source_location loc = std::source_location::current()) :
608 std::string
const &err, std::string
const &Q =
"",
617#if defined(PQXX_HAVE_SOURCE_LOCATION)
619 std::string
const &err, std::string
const &Q =
"",
621 std::source_location loc = std::source_location::current()) :
627 std::string
const &err, std::string
const &Q =
"",
636#if defined(PQXX_HAVE_SOURCE_LOCATION)
638 std::string
const &err, std::string
const &Q =
"",
640 std::source_location loc = std::source_location::current()) :
645 std::string
const &err, std::string
const &Q =
"",
655#if defined(PQXX_HAVE_SOURCE_LOCATION)
657 std::string
const &err, std::string
const &Q =
"",
659 std::source_location loc = std::source_location::current()) :
664 std::string
const &err, std::string
const &Q =
"",
673#if defined(PQXX_HAVE_SOURCE_LOCATION)
675 std::string
const &err, std::string
const &Q =
"",
677 std::source_location loc = std::source_location::current()) :
682 std::string
const &err, std::string
const &Q =
"",
691#if defined(PQXX_HAVE_SOURCE_LOCATION)
693 std::string
const &err, std::string
const &Q =
"",
695 std::source_location loc = std::source_location::current()) :
700 std::string
const &err, std::string
const &Q =
"",
709#if defined(PQXX_HAVE_SOURCE_LOCATION)
711 std::string
const &err,
712 std::source_location loc = std::source_location::current()) :
727#if defined(PQXX_HAVE_SOURCE_LOCATION)
729 std::string
const &err, std::string
const &Q =
"",
731 std::source_location loc = std::source_location::current()) :
736 std::string
const &err, std::string
const &Q =
"",
746#if defined(PQXX_HAVE_SOURCE_LOCATION)
748 std::string
const &err, std::string
const &Q =
"",
750 std::source_location loc = std::source_location::current()) :
755 std::string
const &err, std::string
const &Q =
"",
764#if defined(PQXX_HAVE_SOURCE_LOCATION)
766 std::string
const &err, std::string
const &Q =
"",
768 std::source_location loc = std::source_location::current()) :
773 std::string
const &err, std::string
const &Q =
"",
782#if defined(PQXX_HAVE_SOURCE_LOCATION)
784 std::string
const &err, std::string
const &Q =
"",
786 std::source_location loc = std::source_location::current()) :
791 std::string
const &err, std::string
const &Q =
"",
unexpected_rows(std::string const &msg)
Definition except.hxx:351
in_doubt_error(std::string const &)
too_many_connections(std::string const &err)
Definition except.hxx:716
unexpected_null(std::string const &)
Definition except.cxx:254
feature_not_supported(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:367
out_of_memory(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:699
foreign_key_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:458
range_error(std::string const &)
Definition except.cxx:288
plpgsql_no_data_found(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:772
variable_set_to_null(std::string const &)
Definition except.cxx:68
internal_error(std::string const &)
Definition except.cxx:204
PQXX_PURE std::string const & sqlstate() const noexcept
SQLSTATE error code if known, or empty string otherwise.
undefined_function(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:607
plpgsql_error(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:735
not_null_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:440
invalid_cursor_state(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:512
integrity_constraint_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:404
undefined_column(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:588
virtual ~sql_error() noexcept override
disk_full(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:681
check_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:494
insufficient_privilege(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:644
statement_completion_unknown(std::string const &whatarg, std::string const &q, char const sqlstate[]=nullptr)
Definition except.cxx:170
deadlock_detected(std::string const &whatarg, std::string const &q, char const sqlstate[]=nullptr)
Definition except.cxx:187
restrict_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:422
failure(std::string const &)
Definition except.cxx:23
syntax_error(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr, int pos=-1)
Definition except.hxx:569
conversion_error(std::string const &)
Definition except.cxx:239
argument_error(std::string const &)
Definition except.cxx:224
plpgsql_too_many_rows(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:790
conversion_overrun(std::string const &)
Definition except.cxx:271
data_exception(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:386
unique_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:476
protocol_violation(std::string const &)
Definition except.cxx:51
invalid_sql_statement_name(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:530
broken_connection()
Definition except.cxx:29
plpgsql_raise(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:754
sql_error(std::string const &whatarg="", std::string Q="", char const *sqlstate=nullptr)
Definition except.cxx:85
usage_error(std::string const &)
Definition except.cxx:209
serialization_failure(std::string const &whatarg, std::string const &q, char const sqlstate[]=nullptr)
Definition except.cxx:153
int const error_position
Approximate position in string where error occurred, or -1 if unknown.
Definition except.hxx:559
undefined_table(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:626
transaction_rollback(std::string const &whatarg, std::string const &q="", char const sqlstate[]=nullptr)
Definition except.cxx:136
PQXX_PURE std::string const & query() const noexcept
The query whose execution triggered the exception.
insufficient_resources(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:663
invalid_cursor_name(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:548
The home of all libpqxx classes, functions, templates, etc.
Definition array.cxx:27