libpqxx  v4.0-1
C++ library for PostgreSQL
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pqxx::basic_connection< CONNECTPOLICY > Class Template Reference

The ultimate template that defines a connection type. More...

#include <basic_connection.hxx>

Inheritance diagram for pqxx::basic_connection< CONNECTPOLICY >:
Collaboration diagram for pqxx::basic_connection< CONNECTPOLICY >:

Public Types

enum  error_verbosity {
  terse =0,
  normal =1,
  verbose =2
}
 Error verbosity levels. More...
 

Public Member Functions

 basic_connection ()
 
 basic_connection (const PGSTD::string &opt)
 
 basic_connection (const char opt[])
 
 ~basic_connection () throw ()
 
PGSTD::string adorn_name (const PGSTD::string &)
 Used internally to generate identifiers for SQL objects (such as cursors and nested transactions) based on a given human-readable base name. More...
 
void cancel_query ()
 Attempt to cancel the ongoing query, if any. More...
 
void disconnect () throw ()
 Explicitly close connection. More...
 
PGSTD::string esc (const char str[])
 Escape string for use as SQL string literal on this connection. More...
 
PGSTD::string esc (const char str[], size_t maxlen)
 Escape string for use as SQL string literal on this connection. More...
 
PGSTD::string esc (const PGSTD::string &str)
 Escape string for use as SQL string literal on this connection. More...
 
PGSTD::string esc_raw (const unsigned char str[], size_t len)
 Escape binary string for use as SQL string literal on this connection. More...
 
PGSTD::vector< errorhandler * > get_errorhandlers () const
 Return pointers to the active errorhandlers. More...
 
PGSTD::string get_variable (const PGSTD::string &)
 Read session variable. More...
 
error_verbosity get_verbosity () const throw ()
 Retrieve current error verbosity. More...
 
bool PQXX_PURE is_open () const throw ()
 Is this connection open at the moment? More...
 
const PGSTD::string & options () const throw ()
 
void process_notice (const char[]) throw ()
 Invoke notice processor function. The message should end in newline. More...
 
void process_notice (const PGSTD::string &) throw ()
 Invoke notice processor function. Newline at end is recommended. More...
 
template<typename T >
PGSTD::string quote (const T &t)
 Represent object as SQL string, including quoting & escaping. More...
 
PGSTD::string quote (const binarystring &)
 
PGSTD::string quote_name (const PGSTD::string &identifier)
 Escape and quote an SQL identifier for use in a query. More...
 
PGSTD::string quote_raw (const unsigned char str[], size_t len)
 Escape and quote a string of binary data. More...
 
void set_client_encoding (const PGSTD::string &Encoding)
 Set client-side character encoding. More...
 
void set_variable (const PGSTD::string &Var, const PGSTD::string &Value)
 Set session variable. More...
 
void set_verbosity (error_verbosity verbosity) throw ()
 Set session verbosity. More...
 
void trace (PGSTD::FILE *) throw ()
 Enable tracing to a given output stream, or NULL to disable. More...
 
Activation

Connections can be temporarily deactivated, or they can break because of overly impatient firewalls dropping TCP connections.

Where possible, libpqxx will try to re-activate these when resume using them, or you can wake them up explicitly. You probably won't need this feature, but you should be aware of it.

void activate ()
 Explicitly activate deferred or deactivated connection. More...
 
void deactivate ()
 Explicitly deactivate connection. More...
 
void inhibit_reactivation (bool inhibit)
 Disallow (or permit) connection recovery. More...
 
void simulate_failure ()
 Make the connection fail. More...
 
Connection properties

These are probably not of great interest, since most are derived from information supplied by the client program itself, but they are included for completeness.

const char * dbname ()
 Name of database we're connected to, if any. More...
 
const char * username ()
 Database user ID we're connected under, if any. More...
 
const char * hostname ()
 Address of server, or NULL if none specified (i.e. default or local) More...
 
const char * port ()
 Server port number we're connected to. More...
 
int PQXX_PURE backendpid () const throw ()
 Process ID for backend process. More...
 
int PQXX_PURE sock () const throw ()
 Socket currently used for connection, or -1 for none. Use with care! More...
 
Notifications and Receivers
int get_notifs ()
 Check for pending notifications and take appropriate action. More...
 
int await_notification ()
 Wait for a notification to come in. More...
 
int await_notification (long seconds, long microseconds)
 Wait for a notification to come in, or for given timeout to pass. More...
 
Prepared statements

PostgreSQL supports prepared SQL statements, i.e.

statements that can be registered under a client-provided name, optimized once by the backend, and executed any number of times under the given name.

Prepared statement definitions are not sensitive to transaction boundaries; a statement defined inside a transaction will remain defined outside that transaction, even if the transaction itself is subsequently aborted. Once a statement has been prepared, only closing the connection or explicitly "unpreparing" it can make it go away.

Use the transaction classes' prepared().exec() function to execute a prepared statement. Use prepared().exists() to find out whether a statement has been prepared under a given name.

A special case is the nameless prepared statement. You may prepare a statement without a name. The unnamed statement can be redefined at any time, without un-preparing it first.

Warning
Prepared statements are not necessarily defined on the backend right away; libpqxx generally does that lazily. This means that you can prepare statements before the connection is fully established, and that it's relatively cheap to pre-prepare lots of statements that you may or may not use during the session. On the other hand, it also means that errors in a prepared statement may not show up until you first try to invoke it. Such an error may then break the transaction it occurs in.
Never try to prepare, execute, or unprepare a prepared statement manually using direct SQL queries. Always use the functions provided by libpqxx.
void prepare (const PGSTD::string &name, const PGSTD::string &definition)
 Define a prepared statement. More...
 
void prepare (const PGSTD::string &definition)
 Define a nameless prepared statement. More...
 
void unprepare (const PGSTD::string &name)
 Drop prepared statement. More...
 
void prepare_now (const PGSTD::string &name)
 Request that prepared statement be registered with the server. More...
 
Transactor framework

See the transactor class template for more about transactors.

To use the transactor framework, encapsulate your transaction code in a class derived from an instantiation of the pqxx::transactor template. Then, to execute it, create an object of your transactor class and pass it to one of the perform() functions here.

The perform() functions may create and execute several copies of the transactor before succeeding or ultimately giving up. If there is any doubt over whether execution succeeded (this can happen if the connection to the server is lost just before the backend can confirm success), it is no longer retried and an in_doubt_error is thrown.

Take care: no member functions will ever be invoked on the transactor object you pass into perform(). The object you pass in only serves as a "prototype" for the job to be done. The perform() function will copy-construct transactors from the original you passed in, executing the copies only. The original object remains "clean" in its original state.

template<typename TRANSACTOR >
void perform (const TRANSACTOR &T, int Attempts)
 Perform the transaction defined by a transactor-based object. More...
 
template<typename TRANSACTOR >
void perform (const TRANSACTOR &T)
 Perform the transaction defined by a transactor-based object. More...
 

Protected Member Functions

void close () throw ()
 
void init ()
 
void wait_read () const
 
void wait_read (long seconds, long microseconds) const
 
void wait_write () const
 

Private Attributes

PGSTD::string m_options
 Connect string. Must be initialized before the connector! More...
 
CONNECTPOLICY m_policy
 Connection policy. Must be initialized after the connect string! More...
 

Capabilities

Some functionality is only available in certain versions of the backend, or only when speaking certain versions of the communications protocol that connects us to the backend.

This includes clauses for SQL statements that were not accepted in older database versions, but are required in newer versions to get the same behaviour.

bool supports (capability c) const throw ()
 Does this connection seem to support the given capability? More...
 
int PQXX_PURE protocol_version () const throw ()
 What version of the PostgreSQL protocol is this connection using? More...
 
int PQXX_PURE server_version () const throw ()
 What version of the PostgreSQL server are we connected to? More...
 
enum  capability {
  cap_prepared_statements,
  cap_create_table_with_oids,
  cap_nested_transactions,
  cap_cursor_scroll,
  cap_cursor_with_hold,
  cap_cursor_update,
  cap_cursor_fetch_0,
  cap_table_column,
  cap_read_only_transactions,
  cap_statement_varargs,
  cap_prepare_unnamed_statement,
  cap_parameterized_statements,
  cap_notify_payload,
  cap_end
}
 Session capabilities. More...
 

Detailed Description

template<typename CONNECTPOLICY>
class pqxx::basic_connection< CONNECTPOLICY >

The ultimate template that defines a connection type.

Combines connection_base (the highly complex class implementing essentially all connection-related functionality) with a connection policy (a simpler helper class determining the rules that govern the process of setting up the underlying connection to the backend).

The pattern used to combine these classes is the same as for basic_transaction. Through use of the template mechanism, the policy object is embedded in the basic_connection object so that it does not need to be allocated separately. At the same time this construct avoids the need for any virtual functions in this class, which reduces risks of bugs in construction and destruction; as well as any need to templatize the larger body of code in the connection_base class which might otherwise lead to unacceptable code duplication.

Member Enumeration Documentation

Session capabilities.

Enumerator
cap_prepared_statements 

Does the backend support prepared statements? (If not, we emulate them)

cap_create_table_with_oids 

Can we specify WITH OIDS with CREATE TABLE?

cap_nested_transactions 

Can transactions be nested in other transactions?

cap_cursor_scroll 

Can cursors be declared SCROLL?

cap_cursor_with_hold 

Can cursors be declared WITH HOLD?

cap_cursor_update 

Can cursors be updateable?

cap_cursor_fetch_0 

Can cursors fetch zero elements? (Used to trigger a "fetch all")

cap_table_column 

Can we ask what table column a result column came from?

cap_read_only_transactions 

Can transactions be READ ONLY?

cap_statement_varargs 

Do prepared statements support varargs?

cap_prepare_unnamed_statement 

Is the unnamed prepared statement supported?

cap_parameterized_statements 

Can this connection execute parameterized statements?

cap_notify_payload 

Can notifications carry payloads?

cap_end 

Not a capability value; end-of-enumeration marker.

Error verbosity levels.

Enumerator
terse 
normal 
verbose 

Constructor & Destructor Documentation

template<typename CONNECTPOLICY >
pqxx::basic_connection< CONNECTPOLICY >::basic_connection ( )
inline

References pqxx::connection_base::init().

Here is the call graph for this function:

template<typename CONNECTPOLICY >
pqxx::basic_connection< CONNECTPOLICY >::basic_connection ( const PGSTD::string &  opt)
inlineexplicit

References pqxx::connection_base::init().

Here is the call graph for this function:

template<typename CONNECTPOLICY >
pqxx::basic_connection< CONNECTPOLICY >::basic_connection ( const char  opt[])
inlineexplicit

References pqxx::connection_base::init().

Here is the call graph for this function:

template<typename CONNECTPOLICY >
pqxx::basic_connection< CONNECTPOLICY >::~basic_connection ( ) throw ()
inline

References pqxx::connection_base::close().

Here is the call graph for this function:

Member Function Documentation

void pqxx::connection_base::activate ( )
inherited

Explicitly activate deferred or deactivated connection.

Use of this method is entirely optional. Whenever a connection is used while in a deferred or deactivated state, it will transparently try to bring itself into an activated state. This function is best viewed as an explicit hint to the connection that "if you're not in an active state, now would be a good time to get into one." Whether a connection is currently in an active state or not makes no real difference to its functionality. There is also no particular need to match calls to activate() with calls to deactivate(). A good time to call activate() might be just before you first open a transaction on a lazy connection.

PGSTD::string pqxx::connection_base::adorn_name ( const PGSTD::string &  )
inherited

Used internally to generate identifiers for SQL objects (such as cursors and nested transactions) based on a given human-readable base name.

Suffix unique number to name to make it unique within session context

int pqxx::connection_base::await_notification ( )
inherited

Wait for a notification to come in.

The wait may also be terminated by other events, such as the connection to the backend failing. Any pending or received notifications are processed as part of the call.

Returns
Number of notifications processed
int pqxx::connection_base::await_notification ( long  seconds,
long  microseconds 
)
inherited

Wait for a notification to come in, or for given timeout to pass.

The wait may also be terminated by other events, such as the connection to the backend failing. Any pending or received notifications are processed as part of the call.

Returns
Number of notifications processed
int PQXX_PURE pqxx::connection_base::backendpid ( ) const throw ()
inherited

Process ID for backend process.

Use with care: connections may be lost and automatically re-established without your knowledge, in which case this process ID may no longer be correct. You may, however, assume that this number remains constant and reliable within the span of a successful backend transaction. If the transaction fails, which may be due to a lost connection, then this number will have become invalid at some point within the transaction.

Returns
Process identifier, or 0 if not currently connected.
void pqxx::connection_base::cancel_query ( )
inherited

Attempt to cancel the ongoing query, if any.

void pqxx::connection_base::close ( ) throw ()
protectedinherited

Referenced by pqxx::basic_connection< CONNECTPOLICY >::~basic_connection().

Here is the caller graph for this function:

const char* pqxx::connection_base::dbname ( )
inherited

Name of database we're connected to, if any.

Warning
This activates the connection, which may fail with a broken_connection exception.
void pqxx::connection_base::deactivate ( )
inherited

Explicitly deactivate connection.

Like its counterpart activate(), this method is entirely optional. Calling this function really only makes sense if you won't be using this connection for a while and want to reduce the number of open connections on the database server. There is no particular need to match or pair calls to deactivate() with calls to activate(), but calling deactivate() during a transaction is an error.

void pqxx::connection_base::disconnect ( ) throw ()
inherited

Explicitly close connection.

PGSTD::vector<errorhandler *> pqxx::connection_base::get_errorhandlers ( ) const
inherited

Return pointers to the active errorhandlers.

The entries are ordered from oldest to newest handler.

You may use this to find errorhandlers that your application wants to delete when destroying the connection. Be aware, however, that libpqxx may also add errorhandlers of its own, and those will be included in the list. If this is a problem for you, derive your errorhandlers from a custom base class derived from pqxx::errorhandler. Then use dynamic_cast to find which of the error handlers are yours.

The pointers point to the real errorhandlers. The container it returns however is a copy of the one internal to the connection, not a reference.

int pqxx::connection_base::get_notifs ( )
inherited

Check for pending notifications and take appropriate action.

All notifications found pending at call time are processed by finding any matching receivers and invoking those. If no receivers matched the notification string, none are invoked but the notification is considered processed.

Exceptions thrown by client-registered receivers are reported using the connection's errorhandlers, but the exceptions themselves are not passed on outside this function.

Returns
Number of notifications processed
PGSTD::string pqxx::connection_base::get_variable ( const PGSTD::string &  )
inherited

Read session variable.

Will try to read the value locally, from the list of variables set with the set_variable function. If that fails, the database is queried.

Warning
Do not mix the set_variable interface with manual setting of variables by executing the corresponding SQL commands, and do not get or set variables while a tablestream or pipeline is active on the same connection.
error_verbosity pqxx::connection_base::get_verbosity ( ) const throw ()
inlineinherited

Retrieve current error verbosity.

const char* pqxx::connection_base::hostname ( )
inherited

Address of server, or NULL if none specified (i.e. default or local)

Warning
This activates the connection, which may fail with a broken_connection exception.
void pqxx::connection_base::inhibit_reactivation ( bool  inhibit)
inlineinherited

Disallow (or permit) connection recovery.

A connection whose underlying socket is not currently connected to the server will normally (re-)establish communication with the server whenever needed, or when the client program requests it (although for reasons of integrity, never inside a transaction; but retrying the whole transaction may implicitly cause the connection to be restored). In normal use this is quite a convenient thing to have and presents a simple, safe, predictable interface.

There is at least one situation where this feature is not desirable, however. Although most session state (prepared statements, session variables) is automatically restored to its working state upon connection reactivation, temporary tables and so-called WITH HOLD cursors (which can live outside transactions) are not.

Cursors that live outside transactions are automatically handled, and the library will quietly ignore requests to deactivate or reactivate connections while they exist; it does not want to give you the illusion of being back in your transaction when in reality you just dropped a cursor. With temporary tables this is not so easy: there is no easy way for the library to detect their creation or track their lifetimes.

So if your program uses temporary tables, and any part of this use happens outside of any database transaction (or spans multiple transactions), some of the work you have done on these tables may unexpectedly be undone if the connection is broken or deactivated while any of these tables exists, and then reactivated or implicitly restored before you are finished with it.

If this describes any part of your program, guard it against unexpected reconnections by inhibiting reconnection at the beginning. And if you want to continue doing work on the connection afterwards that no longer requires the temp tables, you can permit it again to get the benefits of connection reactivation for the remainder of the program.

Parameters
inhibitshould reactivation be inhibited from here on?
Warning
Some connection types (the lazy and asynchronous types) defer completion of the socket-level connection until it is actually needed by the client program. Inhibiting reactivation before this connection is really established will prevent these connection types from doing their work. For those connection types, if you are sure that reactivation needs to be inhibited before any query goes across the connection, activate() the connection first. This will ensure that definite activation happens before you inhibit it.
void pqxx::connection_base::init ( )
protectedinherited

Referenced by pqxx::basic_connection< CONNECTPOLICY >::basic_connection().

Here is the caller graph for this function:

bool PQXX_PURE pqxx::connection_base::is_open ( ) const throw ()
inherited

Is this connection open at the moment?

Warning
This function is not needed in most code. Resist the temptation to check it after opening a connection; instead, rely on the broken_connection exception that will be thrown on connection failure.
template<typename CONNECTPOLICY >
const PGSTD::string& pqxx::basic_connection< CONNECTPOLICY >::options ( ) const throw ()
inline
template<typename TRANSACTOR >
void pqxx::connection_base::perform ( const TRANSACTOR &  T,
int  Attempts 
)
inlineinherited

Perform the transaction defined by a transactor-based object.

Invokes the given transactor, making at most Attempts attempts to perform the encapsulated code. If the code throws any exception other than broken_connection, it will be aborted right away.

Parameters
TThe transactor to be executed.
AttemptsMaximum number of attempts to be made to execute T.
template<typename TRANSACTOR >
void pqxx::connection_base::perform ( const TRANSACTOR &  T)
inlineinherited

Perform the transaction defined by a transactor-based object.

Parameters
TThe transactor to be executed.

References pqxx::connection_base::perform().

Referenced by pqxx::connection_base::perform().

Here is the call graph for this function:

Here is the caller graph for this function:

const char* pqxx::connection_base::port ( )
inherited

Server port number we're connected to.

Warning
This activates the connection, which may fail with a broken_connection exception.
void pqxx::connection_base::prepare ( const PGSTD::string &  name,
const PGSTD::string &  definition 
)
inherited

Define a prepared statement.

The statement's definition can refer to a parameter using the parameter's positional number n in the definition. For example, the first parameter can be used as a variable "$1", the second as "$2" and so on.

Here's an example of how to use prepared statements. Note the unusual syntax for passing parameters: every new argument is a parenthesized expression that is simply tacked onto the end of the statement!

using namespace pqxx;
void foo(connection_base &C)
{
C.prepare("findtable", "select * from pg_tables where name=$1");
work W(C);
result R = W.prepared("findtable")("mytable").exec();
if (R.empty()) throw runtime_error("mytable not found!");
}

To save time, prepared statements aren't really registered with the backend until they are first used. If this is not what you want, e.g. because you have very specific realtime requirements, you can use the prepare_now() function to force immediate preparation.

Warning
The statement may not be registered with the backend until it is actually used. So if, for example, the statement is syntactically incorrect, you may see a syntax_error here, or later when you try to call the statement, or in a prepare_now() call.
Parameters
nameunique name for the new prepared statement.
definitionSQL statement to prepare.
void pqxx::connection_base::prepare ( const PGSTD::string &  definition)
inherited

Define a nameless prepared statement.

This can be useful if you merely want to pass large binary parameters to a statement without otherwise wishing to prepare it. If you use this feature, always keep the definition and the use close together to avoid the nameless statement being redefined unexpectedly by code somewhere else.

void pqxx::connection_base::prepare_now ( const PGSTD::string &  name)
inherited

Request that prepared statement be registered with the server.

If the statement had already been fully prepared, this will do nothing.

If the connection should break and be transparently restored, then the new connection will again defer registering the statement with the server. Since connections are never restored inside backend transactions, doing this once at the beginning of your transaction ensures that the statement will not be re-registered during that transaction. In most cases, however, it's probably better not to use this and let the connection decide when and whether to register prepared statements that you've defined.

void pqxx::connection_base::process_notice ( const char  []) throw ()
inherited

Invoke notice processor function. The message should end in newline.

void pqxx::connection_base::process_notice ( const PGSTD::string &  ) throw ()
inherited

Invoke notice processor function. Newline at end is recommended.

int PQXX_PURE pqxx::connection_base::protocol_version ( ) const throw ()
inherited

What version of the PostgreSQL protocol is this connection using?

The answer can be 0 (when there is no connection, or the libpq version being used is too old to obtain the information); 2 for protocol 2.0; 3 for protocol 3.0; and possibly higher values as newer protocol versions are taken into use.

If the connection is broken and restored, the restored connection could possibly a different server and protocol version. This would normally happen if the server is upgraded without shutting down the client program, for example.

Requires libpq version from PostgreSQL 7.4 or better.

int PQXX_PURE pqxx::connection_base::server_version ( ) const throw ()
inherited

What version of the PostgreSQL server are we connected to?

The result is a bit complicated: each of the major, medium, and minor release numbers is written as a two-digit decimal number, and the three are then concatenated. Thus server version 7.4.2 will be returned as the decimal number 70402. If there is no connection to the server, of if the libpq version is too old to obtain the information, zero is returned.

Warning
When writing version numbers in your code, don't add zero at the beginning! Numbers beginning with zero are interpreted as octal (base-8) in C++. Thus, 070402 is not the same as 70402, and 080000 is not a number at all because there is no digit "8" in octal notation. Use strictly decimal notation when it comes to these version numbers.
void pqxx::connection_base::set_client_encoding ( const PGSTD::string &  Encoding)
inlineinherited

Set client-side character encoding.

Search the PostgreSQL documentation for "multibyte" or "character set encodings" to find out more about the available encodings, how to extend them, and how to use them. Not all server-side encodings are compatible with all client-side encodings or vice versa.

Parameters
EncodingName of the character set encoding to use
void pqxx::connection_base::set_variable ( const PGSTD::string &  Var,
const PGSTD::string &  Value 
)
inherited

Set session variable.

Set a session variable for this connection, using the SET command. If the connection to the database is lost and recovered, the last-set value will be restored automatically. See the PostgreSQL documentation for a list of variables that can be set and their permissible values. If a transaction is currently in progress, aborting that transaction will normally discard the newly set value. Known exceptions are nontransaction (which doesn't start a real backend transaction) and PostgreSQL versions prior to 7.3.

Warning
Do not mix the set_variable interface with manual setting of variables by executing the corresponding SQL commands, and do not get or set variables while a tablestream or pipeline is active on the same connection.
Parameters
VarVariable to set
ValueValue vor Var to assume: an identifier, a quoted string, or a number.
void pqxx::connection_base::set_verbosity ( error_verbosity  verbosity) throw ()
inherited

Set session verbosity.

Set the verbosity of error messages to "terse", "normal" (i.e. default) or "verbose."

If "terse", returned messages include severity, primary text, and position only; this will normally fit on a single line. "normal" produces messages that include the above plus any detail, hint, or context fields (these might span multiple lines). "verbose" includes all available fields.

void pqxx::connection_base::simulate_failure ( )
inherited

Make the connection fail.

Warning
Do not use this except for testing! Breaks the connection in some unspecified, horrible, dirty way to enable failure testing.

Do not use this in normal programs. This is only meant for testing.

int PQXX_PURE pqxx::connection_base::sock ( ) const throw ()
inherited

Socket currently used for connection, or -1 for none. Use with care!

Query the current socket number. This is intended for event loops based on functions such as select() or poll(), where multiple file descriptors are watched.

Please try to stay away from this function. It is really only meant for event loops that need to wait on more than one file descriptor. If all you need is to block until a notification arrives, for instance, use await_notification(). If you want to issue queries and retrieve results in nonblocking fashion, check out the pipeline class.

Warning
Don't store this value anywhere, and always be prepared for the possibility that there is no socket. The socket may change or even go away during any invocation of libpqxx code, no matter how trivial.
bool pqxx::connection_base::supports ( capability  c) const throw ()
inlineinherited

Does this connection seem to support the given capability?

Don't try to be smart by caching this information anywhere. Obtaining it is quite fast (especially after the first time) and what's more, a capability may "suddenly" appear or disappear if the connection is broken or deactivated, and then restored. This may happen silently any time no backend transaction is active; if it turns out that the server was upgraded or restored from an older backup, or the new connection goes to a different backend, then the restored session may have different capabilities than were available previously.

Some guesswork is involved in establishing the presence of any capability; try not to rely on this function being exactly right.

Warning
Make sure your connection is active before calling this function, or the answer will always be "no." In particular, if you are using this function on a newly-created lazyconnection, activate the connection first.
void pqxx::connection_base::trace ( PGSTD::FILE *  ) throw ()
inherited

Enable tracing to a given output stream, or NULL to disable.

void pqxx::connection_base::unprepare ( const PGSTD::string &  name)
inherited

Drop prepared statement.

const char* pqxx::connection_base::username ( )
inherited

Database user ID we're connected under, if any.

Warning
This activates the connection, which may fail with a broken_connection exception.
void pqxx::connection_base::wait_read ( ) const
protectedinherited
void pqxx::connection_base::wait_read ( long  seconds,
long  microseconds 
) const
protectedinherited
void pqxx::connection_base::wait_write ( ) const
protectedinherited

Member Data Documentation

template<typename CONNECTPOLICY >
PGSTD::string pqxx::basic_connection< CONNECTPOLICY >::m_options
private

Connect string. Must be initialized before the connector!

template<typename CONNECTPOLICY >
CONNECTPOLICY pqxx::basic_connection< CONNECTPOLICY >::m_policy
private

Connection policy. Must be initialized after the connect string!

Referenced by pqxx::basic_connection< CONNECTPOLICY >::options().


The documentation for this class was generated from the following file: