PG module
Included Modules |
The top-level PG
namespace.
Constants
- POSTGRESQL_LIB_PATH
rake-compiler doesn’t use regular “make install”, but uses it’s own install tasks. It therefore doesn’t copy pg/postgresql_lib_path.rb in case of “rake compile”.
- VERSION
Library version
Public Class Methods
Convenience alias for PG::Connection.new
.
Allows applications to select which security libraries to initialize.
If your application initializes libssl and/or libcrypto libraries and libpq is built with SSL support, you should call PG.init_openssl()
to tell libpq that the libssl and/or libcrypto libraries have been initialized by your application, so that libpq will not also initialize those libraries.
When do_ssl is true
, libpq will initialize the OpenSSL library before first opening a database connection. When do_crypto is true
, the libcrypto library will be initialized. By default (if PG.init_openssl()
is not called), both libraries are initialized. When SSL support is not compiled in, this function is present but does nothing.
If your application uses and initializes either OpenSSL or its underlying libcrypto library, you must call this function with false
for the appropriate parameter(s) before first opening a database connection. Also be sure that you have done that initialization before opening a database connection.
Allows applications to select which security libraries to initialize.
This function is equivalent to PG.init_openssl(do_ssl, do_ssl)
. It is sufficient for applications that initialize both or neither of OpenSSL and libcrypto.
is_threadsafe? → Boolean
threadsafe? → Boolean
Returns true
if libpq is thread-safe, false
otherwise.
Get the version of the libpq library in use. The number is formed by converting the major, minor, and revision numbers into two-decimal- digit numbers and appending them together. For example, version 7.4.2 will be returned as 70402, and version 8.1 will be returned as 80100 (leading zeroes are not shown). Zero is returned if the connection is bad.
Ruby-3.4+ prints a warning, if bigdecimal is required but not in the Gemfile. But it’s a false positive, since we enable bigdecimal depending features only if it’s available. And most people don’t need these features.
Get the PG
library version.
include_buildnum
is no longer used and any value passed will be ignored.