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>
47struct PQXX_LIBEXPORT
failure : std::runtime_error
49#if pqxx_have_source_location
52 std::source_location = std::source_location::current()
54 std::source_location location;
56 explicit failure(std::string
const &);
85#
if pqxx_have_source_location
86 , std::source_location = std::source_location::current()
104#
if pqxx_have_source_location
105 , std::source_location = std::source_location::current()
116#
if pqxx_have_source_location
117 , std::source_location = std::source_location::current()
130 std::string
const m_query;
132 std::string
const m_sqlstate;
136 std::string
const &whatarg =
"", std::string
const &Q =
"",
137 char const sqlstate[] =
nullptr
138#
if pqxx_have_source_location
139 , std::source_location = std::source_location::current()
145 [[nodiscard]] PQXX_PURE std::
string const &query() const noexcept;
148 [[nodiscard]] PQXX_PURE std::
string const &sqlstate() const noexcept;
162#
if pqxx_have_source_location
163 , std::source_location = std::source_location::current()
173 std::string
const &whatarg, std::string
const &q =
"",
174 char const sqlstate[] =
nullptr
175#
if pqxx_have_source_location
176 , std::source_location = std::source_location::current()
194 std::string
const &whatarg, std::string
const &q,
195 char const sqlstate[] =
nullptr
196#
if pqxx_have_source_location
197 , std::source_location = std::source_location::current()
207 std::string
const &whatarg, std::string
const &q,
208 char const sqlstate[] =
nullptr
209#
if pqxx_have_source_location
210 , std::source_location = std::source_location::current()
220 std::string
const &whatarg, std::string
const &q,
221 char const sqlstate[] =
nullptr
222#
if pqxx_have_source_location
223 , std::source_location = std::source_location::current()
240#
if pqxx_have_source_location
241 , std::source_location = std::source_location::current()
245#if pqxx_have_source_location
246 std::source_location location;
255#
if pqxx_have_source_location
256 , std::source_location = std::source_location::current()
260#if pqxx_have_source_location
261 std::source_location location;
270#
if pqxx_have_source_location
271 , std::source_location = std::source_location::current()
275#if pqxx_have_source_location
276 std::source_location location;
285#
if pqxx_have_source_location
286 , std::source_location = std::source_location::current()
296#
if pqxx_have_source_location
297 , std::source_location = std::source_location::current()
307#
if pqxx_have_source_location
308 , std::source_location = std::source_location::current()
312#if pqxx_have_source_location
313 std::source_location location;
321#if pqxx_have_source_location
323 std::string
const &msg,
324 std::source_location loc = std::source_location::current()
336#if pqxx_have_source_location
338 std::string
const &err, std::string
const &Q =
"",
339 char const sqlstate[] =
nullptr,
340 std::source_location loc = std::source_location::current()) :
345 std::string
const &err, std::string
const &Q =
"",
346 char const sqlstate[] =
nullptr) :
355#if pqxx_have_source_location
357 std::string
const &err, std::string
const &Q =
"",
358 char const sqlstate[] =
nullptr,
359 std::source_location loc = std::source_location::current()) :
364 std::string
const &err, std::string
const &Q =
"",
365 char const sqlstate[] =
nullptr) :
373#if pqxx_have_source_location
375 std::string
const &err, std::string
const &Q =
"",
376 char const sqlstate[] =
nullptr,
377 std::source_location loc = std::source_location::current()) :
382 std::string
const &err, std::string
const &Q =
"",
383 char const sqlstate[] =
nullptr) :
391#if pqxx_have_source_location
393 std::string
const &err, std::string
const &Q =
"",
394 char const sqlstate[] =
nullptr,
395 std::source_location loc = std::source_location::current()) :
400 std::string
const &err, std::string
const &Q =
"",
401 char const sqlstate[] =
nullptr) :
409#if pqxx_have_source_location
411 std::string
const &err, std::string
const &Q =
"",
412 char const sqlstate[] =
nullptr,
413 std::source_location loc = std::source_location::current()) :
418 std::string
const &err, std::string
const &Q =
"",
419 char const sqlstate[] =
nullptr) :
427#if pqxx_have_source_location
429 std::string
const &err, std::string
const &Q =
"",
430 char const sqlstate[] =
nullptr,
431 std::source_location loc = std::source_location::current()) :
436 std::string
const &err, std::string
const &Q =
"",
437 char const sqlstate[] =
nullptr) :
445#if pqxx_have_source_location
447 std::string
const &err, std::string
const &Q =
"",
448 char const sqlstate[] =
nullptr,
449 std::source_location loc = std::source_location::current()) :
454 std::string
const &err, std::string
const &Q =
"",
455 char const sqlstate[] =
nullptr) :
463#if pqxx_have_source_location
465 std::string
const &err, std::string
const &Q =
"",
466 char const sqlstate[] =
nullptr,
467 std::source_location loc = std::source_location::current()) :
472 std::string
const &err, std::string
const &Q =
"",
473 char const sqlstate[] =
nullptr) :
481#if pqxx_have_source_location
483 std::string
const &err, std::string
const &Q =
"",
484 char const sqlstate[] =
nullptr,
485 std::source_location loc = std::source_location::current()) :
490 std::string
const &err, std::string
const &Q =
"",
491 char const sqlstate[] =
nullptr) :
499#if pqxx_have_source_location
501 std::string
const &err, std::string
const &Q =
"",
502 char const sqlstate[] =
nullptr,
503 std::source_location loc = std::source_location::current()) :
508 std::string
const &err, std::string
const &Q =
"",
509 char const sqlstate[] =
nullptr) :
517#if pqxx_have_source_location
519 std::string
const &err, std::string
const &Q =
"",
520 char const sqlstate[] =
nullptr,
521 std::source_location loc = std::source_location::current()) :
526 std::string
const &err, std::string
const &Q =
"",
527 char const sqlstate[] =
nullptr) :
538#if pqxx_have_source_location
540 std::string
const &err, std::string
const &Q =
"",
541 char const sqlstate[] =
nullptr,
int pos = -1,
542 std::source_location loc = std::source_location::current()) :
543 sql_error{err, Q, sqlstate, loc}, error_position{pos}
547 std::string
const &err, std::string
const &Q =
"",
548 char const sqlstate[] =
nullptr,
int pos = -1) :
549 sql_error{err, Q, sqlstate}, error_position{pos}
556#if pqxx_have_source_location
558 std::string
const &err, std::string
const &Q =
"",
559 char const sqlstate[] =
nullptr,
560 std::source_location loc = std::source_location::current()) :
566 std::string
const &err, std::string
const &Q =
"",
567 char const sqlstate[] =
nullptr) :
575#if pqxx_have_source_location
577 std::string
const &err, std::string
const &Q =
"",
578 char const sqlstate[] =
nullptr,
579 std::source_location loc = std::source_location::current()) :
585 std::string
const &err, std::string
const &Q =
"",
586 char const sqlstate[] =
nullptr) :
594#if pqxx_have_source_location
596 std::string
const &err, std::string
const &Q =
"",
597 char const sqlstate[] =
nullptr,
598 std::source_location loc = std::source_location::current()) :
604 std::string
const &err, std::string
const &Q =
"",
605 char const sqlstate[] =
nullptr) :
613#if pqxx_have_source_location
615 std::string
const &err, std::string
const &Q =
"",
616 char const sqlstate[] =
nullptr,
617 std::source_location loc = std::source_location::current()) :
622 std::string
const &err, std::string
const &Q =
"",
623 char const sqlstate[] =
nullptr) :
632#if pqxx_have_source_location
634 std::string
const &err, std::string
const &Q =
"",
635 char const sqlstate[] =
nullptr,
636 std::source_location loc = std::source_location::current()) :
641 std::string
const &err, std::string
const &Q =
"",
642 char const sqlstate[] =
nullptr) :
650#if pqxx_have_source_location
652 std::string
const &err, std::string
const &Q =
"",
653 char const sqlstate[] =
nullptr,
654 std::source_location loc = std::source_location::current()) :
659 std::string
const &err, std::string
const &Q =
"",
660 char const sqlstate[] =
nullptr) :
668#if pqxx_have_source_location
670 std::string
const &err, std::string
const &Q =
"",
671 char const sqlstate[] =
nullptr,
672 std::source_location loc = std::source_location::current()) :
677 std::string
const &err, std::string
const &Q =
"",
678 char const sqlstate[] =
nullptr) :
686#if pqxx_have_source_location
688 std::string
const &err,
689 std::source_location loc = std::source_location::current()
705#if pqxx_have_source_location
707 std::string
const &err, std::string
const &Q =
"",
708 char const sqlstate[] =
nullptr,
709 std::source_location loc = std::source_location::current()) :
714 std::string
const &err, std::string
const &Q =
"",
715 char const sqlstate[] =
nullptr) :
724#if pqxx_have_source_location
726 std::string
const &err, std::string
const &Q =
"",
727 char const sqlstate[] =
nullptr,
728 std::source_location loc = std::source_location::current()) :
733 std::string
const &err, std::string
const &Q =
"",
734 char const sqlstate[] =
nullptr) :
742#if pqxx_have_source_location
744 std::string
const &err, std::string
const &Q =
"",
745 char const sqlstate[] =
nullptr,
746 std::source_location loc = std::source_location::current()) :
751 std::string
const &err, std::string
const &Q =
"",
752 char const sqlstate[] =
nullptr) :
760#if pqxx_have_source_location
762 std::string
const &err, std::string
const &Q =
"",
763 char const sqlstate[] =
nullptr,
764 std::source_location loc = std::source_location::current()) :
769 std::string
const &err, std::string
const &Q =
"",
770 char const sqlstate[] =
nullptr) :
The home of all libpqxx classes, functions, templates, etc.
Definition array.hxx:33
Run-time failure encountered by libpqxx, similar to std::runtime_error.
Definition except.hxx:48
Exception class for lost or failed backend connection.
Definition except.hxx:82
Exception class for micommunication with the server.
Definition except.hxx:102
The caller attempted to set a variable to null, which is not allowed.
Definition except.hxx:113
Exception class for failed queries.
Definition except.hxx:128
virtual ~sql_error() noexcept override
"Help, I don't know whether transaction was committed successfully!"
Definition except.hxx:160
The backend saw itself forced to roll back the ongoing transaction.
Definition except.hxx:171
Transaction failed to serialize. Please retry it.
Definition except.hxx:192
We can't tell whether our last statement succeeded.
Definition except.hxx:205
The ongoing transaction has deadlocked. Retrying it may help.
Definition except.hxx:218
Internal error in libpqxx library.
Definition except.hxx:231
Error in usage of libpqxx library, similar to std::logic_error.
Definition except.hxx:238
Invalid argument passed to libpqxx, similar to std::invalid_argument.
Definition except.hxx:253
Value conversion failed, e.g. when converting "Hello" to int.
Definition except.hxx:268
Could not convert null value: target type does not support null.
Definition except.hxx:283
Could not convert value to string: not enough buffer space.
Definition except.hxx:294
Something is out of range, similar to std::out_of_range.
Definition except.hxx:305
Query returned an unexpected number of rows.
Definition except.hxx:320
unexpected_rows(std::string const &msg)
Definition except.hxx:328
Database feature not supported in current setup.
Definition except.hxx:335
feature_not_supported(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:344
Error in data provided to SQL statement.
Definition except.hxx:354
data_exception(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:363
Definition except.hxx:372
integrity_constraint_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:381
Definition except.hxx:390
restrict_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:399
Definition except.hxx:408
not_null_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:417
Definition except.hxx:426
foreign_key_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:435
Definition except.hxx:444
unique_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:453
Definition except.hxx:462
check_violation(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:471
Definition except.hxx:480
invalid_cursor_state(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:489
Definition except.hxx:498
invalid_sql_statement_name(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:507
Definition except.hxx:516
invalid_cursor_name(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:525
Definition except.hxx:534
syntax_error(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr, int pos=-1)
Definition except.hxx:546
int const error_position
Approximate position in string where error occurred, or -1 if unknown.
Definition except.hxx:536
Definition except.hxx:555
undefined_column(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:565
Definition except.hxx:574
undefined_function(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:584
Definition except.hxx:593
undefined_table(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:603
Definition except.hxx:612
insufficient_privilege(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:621
Resource shortage on the server.
Definition except.hxx:631
insufficient_resources(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:640
Definition except.hxx:649
disk_full(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:658
Definition except.hxx:667
out_of_memory(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:676
Definition except.hxx:685
too_many_connections(std::string const &err)
Definition except.hxx:694
PL/pgSQL error.
Definition except.hxx:704
plpgsql_error(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:713
Exception raised in PL/pgSQL procedure.
Definition except.hxx:723
plpgsql_raise(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:732
Definition except.hxx:741
plpgsql_no_data_found(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:750
Definition except.hxx:759
plpgsql_too_many_rows(std::string const &err, std::string const &Q="", char const sqlstate[]=nullptr)
Definition except.hxx:768