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>
46 struct PQXX_LIBEXPORT failure : std::runtime_error
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 &);
83 explicit broken_connection(
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 =
"",
141 char const *sqlstate =
nullptr
142 #
if defined(PQXX_HAVE_SOURCE_LOCATION)
144 std::source_location = std::source_location::current()
150 [[nodiscard]] PQXX_PURE std::string
const &query()
const noexcept;
153 [[nodiscard]] PQXX_PURE std::string
const &sqlstate()
const noexcept;
168 #
if defined(PQXX_HAVE_SOURCE_LOCATION)
170 std::source_location = std::source_location::current()
180 std::string
const &whatarg, std::string
const &q =
"",
181 char const sqlstate[] =
nullptr
182 #
if defined(PQXX_HAVE_SOURCE_LOCATION)
184 std::source_location = std::source_location::current()
202 std::string
const &whatarg, std::string
const &q,
203 char const sqlstate[] =
nullptr
204 #
if defined(PQXX_HAVE_SOURCE_LOCATION)
206 std::source_location = std::source_location::current()
216 std::string
const &whatarg, std::string
const &q,
217 char const sqlstate[] =
nullptr
218 #
if defined(PQXX_HAVE_SOURCE_LOCATION)
220 std::source_location = std::source_location::current()
230 std::string
const &whatarg, std::string
const &q,
231 char const sqlstate[] =
nullptr
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()) :
351 explicit unexpected_rows(std::string
const &msg) :
range_error{msg} {}
359 #if defined(PQXX_HAVE_SOURCE_LOCATION)
361 std::string
const &err, std::string
const &Q =
"",
362 char const sqlstate[] =
nullptr,
363 std::source_location loc = std::source_location::current()) :
367 explicit feature_not_supported(
368 std::string
const &err, std::string
const &Q =
"",
369 char const sqlstate[] =
nullptr) :
378 #if defined(PQXX_HAVE_SOURCE_LOCATION)
380 std::string
const &err, std::string
const &Q =
"",
381 char const sqlstate[] =
nullptr,
382 std::source_location loc = std::source_location::current()) :
386 explicit data_exception(
387 std::string
const &err, std::string
const &Q =
"",
388 char const sqlstate[] =
nullptr) :
396 #if defined(PQXX_HAVE_SOURCE_LOCATION)
398 std::string
const &err, std::string
const &Q =
"",
399 char const sqlstate[] =
nullptr,
400 std::source_location loc = std::source_location::current()) :
404 explicit integrity_constraint_violation(
405 std::string
const &err, std::string
const &Q =
"",
406 char const sqlstate[] =
nullptr) :
414 #if defined(PQXX_HAVE_SOURCE_LOCATION)
416 std::string
const &err, std::string
const &Q =
"",
417 char const sqlstate[] =
nullptr,
418 std::source_location loc = std::source_location::current()) :
422 explicit restrict_violation(
423 std::string
const &err, std::string
const &Q =
"",
424 char const sqlstate[] =
nullptr) :
432 #if defined(PQXX_HAVE_SOURCE_LOCATION)
434 std::string
const &err, std::string
const &Q =
"",
435 char const sqlstate[] =
nullptr,
436 std::source_location loc = std::source_location::current()) :
440 explicit not_null_violation(
441 std::string
const &err, std::string
const &Q =
"",
442 char const sqlstate[] =
nullptr) :
450 #if defined(PQXX_HAVE_SOURCE_LOCATION)
452 std::string
const &err, std::string
const &Q =
"",
453 char const sqlstate[] =
nullptr,
454 std::source_location loc = std::source_location::current()) :
458 explicit foreign_key_violation(
459 std::string
const &err, std::string
const &Q =
"",
460 char const sqlstate[] =
nullptr) :
468 #if defined(PQXX_HAVE_SOURCE_LOCATION)
470 std::string
const &err, std::string
const &Q =
"",
471 char const sqlstate[] =
nullptr,
472 std::source_location loc = std::source_location::current()) :
476 explicit unique_violation(
477 std::string
const &err, std::string
const &Q =
"",
478 char const sqlstate[] =
nullptr) :
486 #if defined(PQXX_HAVE_SOURCE_LOCATION)
488 std::string
const &err, std::string
const &Q =
"",
489 char const sqlstate[] =
nullptr,
490 std::source_location loc = std::source_location::current()) :
494 explicit check_violation(
495 std::string
const &err, std::string
const &Q =
"",
496 char const sqlstate[] =
nullptr) :
504 #if defined(PQXX_HAVE_SOURCE_LOCATION)
506 std::string
const &err, std::string
const &Q =
"",
507 char const sqlstate[] =
nullptr,
508 std::source_location loc = std::source_location::current()) :
512 explicit invalid_cursor_state(
513 std::string
const &err, std::string
const &Q =
"",
514 char const sqlstate[] =
nullptr) :
522 #if defined(PQXX_HAVE_SOURCE_LOCATION)
524 std::string
const &err, std::string
const &Q =
"",
525 char const sqlstate[] =
nullptr,
526 std::source_location loc = std::source_location::current()) :
530 explicit invalid_sql_statement_name(
531 std::string
const &err, std::string
const &Q =
"",
532 char const sqlstate[] =
nullptr) :
540 #if defined(PQXX_HAVE_SOURCE_LOCATION)
542 std::string
const &err, std::string
const &Q =
"",
543 char const sqlstate[] =
nullptr,
544 std::source_location loc = std::source_location::current()) :
548 explicit invalid_cursor_name(
549 std::string
const &err, std::string
const &Q =
"",
550 char const sqlstate[] =
nullptr) :
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()) :
566 sql_error{err, Q, sqlstate, loc}, error_position{pos}
569 explicit syntax_error(
570 std::string
const &err, std::string
const &Q =
"",
571 char const sqlstate[] =
nullptr,
int pos = -1) :
572 sql_error{err, Q, sqlstate}, error_position{pos}
579 #if defined(PQXX_HAVE_SOURCE_LOCATION)
581 std::string
const &err, std::string
const &Q =
"",
582 char const sqlstate[] =
nullptr,
583 std::source_location loc = std::source_location::current()) :
588 explicit undefined_column(
589 std::string
const &err, std::string
const &Q =
"",
590 char const sqlstate[] =
nullptr) :
598 #if defined(PQXX_HAVE_SOURCE_LOCATION)
600 std::string
const &err, std::string
const &Q =
"",
601 char const sqlstate[] =
nullptr,
602 std::source_location loc = std::source_location::current()) :
607 explicit undefined_function(
608 std::string
const &err, std::string
const &Q =
"",
609 char const sqlstate[] =
nullptr) :
617 #if defined(PQXX_HAVE_SOURCE_LOCATION)
619 std::string
const &err, std::string
const &Q =
"",
620 char const sqlstate[] =
nullptr,
621 std::source_location loc = std::source_location::current()) :
626 explicit undefined_table(
627 std::string
const &err, std::string
const &Q =
"",
628 char const sqlstate[] =
nullptr) :
636 #if defined(PQXX_HAVE_SOURCE_LOCATION)
638 std::string
const &err, std::string
const &Q =
"",
639 char const sqlstate[] =
nullptr,
640 std::source_location loc = std::source_location::current()) :
644 explicit insufficient_privilege(
645 std::string
const &err, std::string
const &Q =
"",
646 char const sqlstate[] =
nullptr) :
655 #if defined(PQXX_HAVE_SOURCE_LOCATION)
657 std::string
const &err, std::string
const &Q =
"",
658 char const sqlstate[] =
nullptr,
659 std::source_location loc = std::source_location::current()) :
663 explicit insufficient_resources(
664 std::string
const &err, std::string
const &Q =
"",
665 char const sqlstate[] =
nullptr) :
673 #if defined(PQXX_HAVE_SOURCE_LOCATION)
675 std::string
const &err, std::string
const &Q =
"",
676 char const sqlstate[] =
nullptr,
677 std::source_location loc = std::source_location::current()) :
682 std::string
const &err, std::string
const &Q =
"",
683 char const sqlstate[] =
nullptr) :
691 #if defined(PQXX_HAVE_SOURCE_LOCATION)
693 std::string
const &err, std::string
const &Q =
"",
694 char const sqlstate[] =
nullptr,
695 std::source_location loc = std::source_location::current()) :
699 explicit out_of_memory(
700 std::string
const &err, std::string
const &Q =
"",
701 char const sqlstate[] =
nullptr) :
709 #if defined(PQXX_HAVE_SOURCE_LOCATION)
711 std::string
const &err,
712 std::source_location loc = std::source_location::current()) :
716 explicit too_many_connections(std::string
const &err) :
727 #if defined(PQXX_HAVE_SOURCE_LOCATION)
729 std::string
const &err, std::string
const &Q =
"",
730 char const sqlstate[] =
nullptr,
731 std::source_location loc = std::source_location::current()) :
735 explicit plpgsql_error(
736 std::string
const &err, std::string
const &Q =
"",
737 char const sqlstate[] =
nullptr) :
746 #if defined(PQXX_HAVE_SOURCE_LOCATION)
748 std::string
const &err, std::string
const &Q =
"",
749 char const sqlstate[] =
nullptr,
750 std::source_location loc = std::source_location::current()) :
754 explicit plpgsql_raise(
755 std::string
const &err, std::string
const &Q =
"",
756 char const sqlstate[] =
nullptr) :
764 #if defined(PQXX_HAVE_SOURCE_LOCATION)
766 std::string
const &err, std::string
const &Q =
"",
767 char const sqlstate[] =
nullptr,
768 std::source_location loc = std::source_location::current()) :
772 explicit plpgsql_no_data_found(
773 std::string
const &err, std::string
const &Q =
"",
774 char const sqlstate[] =
nullptr) :
782 #if defined(PQXX_HAVE_SOURCE_LOCATION)
784 std::string
const &err, std::string
const &Q =
"",
785 char const sqlstate[] =
nullptr,
786 std::source_location loc = std::source_location::current()) :
790 explicit plpgsql_too_many_rows(
791 std::string
const &err, std::string
const &Q =
"",
792 char const sqlstate[] =
nullptr) :
Definition: except.hxx:520
Definition: except.hxx:577
Definition: except.hxx:394
PL/pgSQL error.
Definition: except.hxx:725
Definition: except.hxx:671
Error in usage of libpqxx library, similar to std::logic_error.
Definition: except.hxx:248
Exception class for lost or failed backend connection.
Definition: except.hxx:80
Error in data provided to SQL statement.
Definition: except.hxx:376
Definition: except.hxx:484
Exception raised in PL/pgSQL procedure.
Definition: except.hxx:744
Definition: except.hxx:466
Resource shortage on the server.
Definition: except.hxx:653
Exception class for failed queries.
Definition: except.hxx:131
int const error_position
Approximate position in string where error occurred, or -1 if unknown.
Definition: except.hxx:559
Something is out of range, similar to std::out_of_range.
Definition: except.hxx:325
Definition: except.hxx:448
Definition: except.hxx:538
Definition: except.hxx:430
Exception class for micommunication with the server.
Definition: except.hxx:102
Definition: except.hxx:762
Definition: except.hxx:707
Definition: except.hxx:615
The ongoing transaction has deadlocked. Retrying it may help.
Definition: except.hxx:227
Could not convert value to string: not enough buffer space.
Definition: except.hxx:312
Run-time failure encountered by libpqxx, similar to std::runtime_error.
Definition: except.hxx:47
Definition: except.hxx:596
Query returned an unexpected number of rows.
Definition: except.hxx:342
Definition: except.hxx:634
The backend saw itself forced to roll back the ongoing transaction.
Definition: except.hxx:177
Value conversion failed, e.g. when converting "Hello" to int.
Definition: except.hxx:282
Database feature not supported in current setup.
Definition: except.hxx:357
Transaction failed to serialize. Please retry it.
Definition: except.hxx:199
The home of all libpqxx classes, functions, templates, etc.
Definition: array.cxx:26
Could not convert null value: target type does not support null.
Definition: except.hxx:299
We can't tell whether our last statement succeeded.
Definition: except.hxx:213
Definition: except.hxx:502
Definition: except.hxx:556
Invalid argument passed to libpqxx, similar to std::invalid_argument.
Definition: except.hxx:265
The caller attempted to set a variable to null, which is not allowed.
Definition: except.hxx:115
Definition: except.hxx:780
Internal error in libpqxx library.
Definition: except.hxx:241
"Help, I don't know whether transaction was committed successfully!"
Definition: except.hxx:164
Definition: except.hxx:689
Definition: except.hxx:412