16 #if !defined(PQXX_HEADER_PRE) 17 # error "Include libpqxx headers as <pqxx/header>, not <pqxx/header.hxx>." 20 #if pqxx_have_source_location 21 # include <source_location> 46 struct PQXX_LIBEXPORT failure : std::runtime_error
49 #if 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 pqxx_have_source_location
87 std::source_location = std::source_location::current()
106 #
if pqxx_have_source_location
108 std::source_location = std::source_location::current()
119 #
if 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
const &Q =
"",
141 char const sqlstate[] =
nullptr 142 #
if 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 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 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 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 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 pqxx_have_source_location
234 std::source_location = std::source_location::current()
252 #
if pqxx_have_source_location
254 std::source_location = std::source_location::current()
258 #if pqxx_have_source_location 259 std::source_location location;
269 #
if pqxx_have_source_location
271 std::source_location = std::source_location::current()
275 #if pqxx_have_source_location 276 std::source_location location;
286 #
if pqxx_have_source_location
288 std::source_location = std::source_location::current()
292 #if pqxx_have_source_location 293 std::source_location location;
303 #
if pqxx_have_source_location
305 std::source_location = std::source_location::current()
316 #
if pqxx_have_source_location
318 std::source_location = std::source_location::current()
329 #
if pqxx_have_source_location
331 std::source_location = std::source_location::current()
335 #if pqxx_have_source_location 336 std::source_location location;
344 #if pqxx_have_source_location 346 std::string
const &msg,
347 std::source_location loc = std::source_location::current()) :
359 #if 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()) :
368 std::string
const &err, std::string
const &Q =
"",
369 char const sqlstate[] =
nullptr) :
378 #if 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()) :
387 std::string
const &err, std::string
const &Q =
"",
388 char const sqlstate[] =
nullptr) :
396 #if 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()) :
405 std::string
const &err, std::string
const &Q =
"",
406 char const sqlstate[] =
nullptr) :
414 #if 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()) :
423 std::string
const &err, std::string
const &Q =
"",
424 char const sqlstate[] =
nullptr) :
432 #if 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()) :
441 std::string
const &err, std::string
const &Q =
"",
442 char const sqlstate[] =
nullptr) :
450 #if 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()) :
459 std::string
const &err, std::string
const &Q =
"",
460 char const sqlstate[] =
nullptr) :
468 #if 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()) :
477 std::string
const &err, std::string
const &Q =
"",
478 char const sqlstate[] =
nullptr) :
486 #if 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()) :
495 std::string
const &err, std::string
const &Q =
"",
496 char const sqlstate[] =
nullptr) :
504 #if 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()) :
513 std::string
const &err, std::string
const &Q =
"",
514 char const sqlstate[] =
nullptr) :
522 #if 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()) :
531 std::string
const &err, std::string
const &Q =
"",
532 char const sqlstate[] =
nullptr) :
540 #if 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()) :
549 std::string
const &err, std::string
const &Q =
"",
550 char const sqlstate[] =
nullptr) :
561 #if 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}
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 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()) :
589 std::string
const &err, std::string
const &Q =
"",
590 char const sqlstate[] =
nullptr) :
598 #if 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()) :
608 std::string
const &err, std::string
const &Q =
"",
609 char const sqlstate[] =
nullptr) :
617 #if 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()) :
627 std::string
const &err, std::string
const &Q =
"",
628 char const sqlstate[] =
nullptr) :
636 #if 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()) :
645 std::string
const &err, std::string
const &Q =
"",
646 char const sqlstate[] =
nullptr) :
655 #if 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()) :
664 std::string
const &err, std::string
const &Q =
"",
665 char const sqlstate[] =
nullptr) :
673 #if 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 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()) :
700 std::string
const &err, std::string
const &Q =
"",
701 char const sqlstate[] =
nullptr) :
709 #if pqxx_have_source_location 711 std::string
const &err,
712 std::source_location loc = std::source_location::current()) :
727 #if 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()) :
736 std::string
const &err, std::string
const &Q =
"",
737 char const sqlstate[] =
nullptr) :
746 #if 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()) :
755 std::string
const &err, std::string
const &Q =
"",
756 char const sqlstate[] =
nullptr) :
764 #if 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()) :
773 std::string
const &err, std::string
const &Q =
"",
774 char const sqlstate[] =
nullptr) :
782 #if 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()) :
791 std::string
const &err, std::string
const &Q =
"",
792 char const sqlstate[] =
nullptr) :
Error in usage of libpqxx library, similar to std::logic_error.
Definition: except.hxx:248
Definition: except.hxx:596
restrict_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:422
We can't tell whether our last statement succeeded.
Definition: except.hxx:213
disk_full(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:681
unique_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:476
Something is out of range, similar to std::out_of_range.
Definition: except.hxx:325
Definition: except.hxx:689
Value conversion failed, e.g. when converting "Hello" to int.
Definition: except.hxx:282
Definition: except.hxx:634
too_many_connections(std::string const &err)
Definition: except.hxx:716
undefined_column(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:588
check_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:494
Definition: except.hxx:412
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:32
Definition: except.hxx:780
Database feature not supported in current setup.
Definition: except.hxx:357
PL/pgSQL error.
Definition: except.hxx:725
Exception class for lost or failed backend connection.
Definition: except.hxx:80
invalid_cursor_name(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:548
Definition: except.hxx:502
Internal error in libpqxx library.
Definition: except.hxx:241
foreign_key_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:458
Definition: except.hxx:448
Transaction failed to serialize. Please retry it.
Definition: except.hxx:199
plpgsql_too_many_rows(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:790
Could not convert value to string: not enough buffer space.
Definition: except.hxx:312
The caller attempted to set a variable to null, which is not allowed.
Definition: except.hxx:115
Definition: except.hxx:671
invalid_sql_statement_name(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:530
Definition: except.hxx:538
Invalid argument passed to libpqxx, similar to std::invalid_argument.
Definition: except.hxx:265
Definition: except.hxx:615
The ongoing transaction has deadlocked. Retrying it may help.
Definition: except.hxx:227
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
Definition: except.hxx:394
data_exception(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:386
Definition: except.hxx:762
Query returned an unexpected number of rows.
Definition: except.hxx:342
Definition: except.hxx:707
Could not convert null value: target type does not support null.
Definition: except.hxx:299
Resource shortage on the server.
Definition: except.hxx:653
plpgsql_error(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:735
plpgsql_raise(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:754
not_null_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:440
Run-time failure encountered by libpqxx, similar to std::runtime_error.
Definition: except.hxx:47
undefined_function(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:607
Definition: except.hxx:484
Definition: except.hxx:430
Error in data provided to SQL statement.
Definition: except.hxx:376
Exception raised in PL/pgSQL procedure.
Definition: except.hxx:744
out_of_memory(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:699
"Help, I don't know whether transaction was committed successfully!"
Definition: except.hxx:164
Definition: except.hxx:577
syntax_error(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr, int pos=-1)
Definition: except.hxx:569
Exception class for micommunication with the server.
Definition: except.hxx:102
unexpected_rows(std::string const &msg)
Definition: except.hxx:351
Definition: except.hxx:520
Definition: except.hxx:466
invalid_cursor_state(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:512
feature_not_supported(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:367
Exception class for failed queries.
Definition: except.hxx:131
integrity_constraint_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:404
Definition: except.hxx:556
insufficient_privilege(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:644
insufficient_resources(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:663
The backend saw itself forced to roll back the ongoing transaction.
Definition: except.hxx:177
plpgsql_no_data_found(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition: except.hxx:772