== v1.4.1 [2022-06-24] Lars Kanis Bugfixes: - Fix another ruby-2.7 keyword warning. #465 - Allow PG::Error to be created without arguments. #466 == v1.4.0 [2022-06-20] Lars Kanis Added: - Add PG::Connection#hostaddr, present since PostgreSQL-12. #453 - Add PG::Connection.conninfo_parse to wrap PQconninfoParse. #453 Bugfixes: - Try IPv6 and IPv4 addresses, if DNS resolves to both. #452 - Re-add block-call semantics to PG::Connection.new accidently removed in pg-1.3.0. #454 - Handle client error after all data consumed in #copy_data for output. #455 - Avoid spurious keyword argument warning on Ruby 2.7. #456 - Change connection setup to respect connect_timeout parameter. #459 - Fix indefinite hang in case of connection error on Windows #458 - Set connection attribute of PG::Error in various places where it was missing. #461 - Fix transaction leak on early break/return. #463 - Update Windows fat binary gem to OpenSSL-1.1.1o and PostgreSQL-14.4. Enhancements: - Don't flush at each put_copy_data call, but flush at get_result. #462 == v1.3.5 [2022-03-31] Lars Kanis Bugfixes: - Handle PGRES_COMMAND_OK in pgresult_stream_any. #447 Fixes usage when trying to stream the result of a procedure call that returns no results. Enhancements: - Rename BasicTypeRegistry#define_default_types to #register_default_types to use a more consistent terminology. Keeping define_default_types for compatibility. - BasicTypeRegistry: return self instead of objects by accident. This allows call chaining. - Add some April fun. #449 Documentation: - Refine documentation of conn.socket_io and conn.connect_poll == v1.3.4 [2022-03-10] Lars Kanis Bugfixes: - Don't leak IO in case of connection errors. #439 Previously it was kept open until the PG::Connection was garbage collected. - Fix a performance regession in conn.get_result noticed in single row mode. #442 - Fix occasional error Errno::EBADF (Bad file descriptor) while connecting. #444 - Fix compatibility of res.stream_each* methods with Fiber.scheduler. #446 - Remove FL_TEST and FL_SET, which are MRI-internal. #437 Enhancements: - Allow pgresult_stream_any to be used by sequel_pg. #443 == v1.3.3 [2022-02-22] Lars Kanis Bugfixes: - Fix omission of the third digit of IPv4 addresses in connection URI. #435 - Fix wrong permission of certs/larskanis-2022.pem in the pg-1.3.2.gem. #432 == v1.3.2 [2022-02-14] Lars Kanis Bugfixes: - Cancel only active query after failing transaction. #430 This avoids an incompatibility with pgbouncer since pg-1.3.0. - Fix String objects with non-applied encoding when using COPY or record decoders. #427 - Update Windows fat binary gem to PostgreSQL-14.2. Enhancements: - Improve extconf.rb checks to reduces the number of compiler calls. - Add a check for PGRES_PIPELINE_SYNC, to make sure the library version and the header files are PostgreSQL-14+. #429 == v1.3.1 [2022-02-01] Michael Granger Bugfixes: - Fix wrong handling of socket writability on Windows introduced in #417. This caused starvation in conn.put_copy_data. - Fix error in PG.version_string(true). #419 - Fix a regression in pg 1.3.0 where Ruby 2.x busy-looping any fractional seconds for every wait. #420 Enhancements: - Raise an error when conn.copy_data is used in nonblocking mode. == v1.3.0 [2022-01-20] Michael Granger Install Enhancements: - Print some install help if libpq wasn't found. #396 This should help to pick the necessary package without googling. - Update Windows fat binary gem to OpenSSL-1.1.1m and PostgreSQL-14.1. - Add binary Windows gems for Ruby 3.0 and 3.1. - Make the library path of libpq available in ruby as PG::POSTGRESQL_LIB_PATH and add it to the search paths on Windows similar to +rpath+ on Unix systems. #373 - Fall back to pkg-config if pg_config is not found. #380 - Add option to extconf.rb to disable nogvl-wrapping of libpq functions. All methods (except PG::Connection.ping) are nonblocking now, so that GVL unlock is in theory no longer necessary. However it can have some advantage in concurrency, so that GVL unlock is still enabled by default. Use: - gem inst pg -- --disable-gvl-unlock API Enhancements: - Add full compatibility to Fiber.scheduler introduced in Ruby-3.0. #397 - Add async_connect and async_send methods and add specific specs for Fiber.scheduler #342 - Add async_get_result and async_get_last_result - Add async_get_copy_data - Implement async_put_copy_data/async_put_copy_end - Implement async_reset method using the nonblocking libpq API - Add async_set_client_encoding which is compatible to scheduler - Add async_cancel as a nonblocking version of conn#cancel - Add async_encrypt_password - Run Connection.ping in a second thread. - Make discard_results scheduler friendly - Do all socket waiting through the conn.socket_io object. - Avoid PG.connect blocking while address resolution by automatically providing the +hostaddr+ parameter and resolving in Ruby instead of libpq. - On Windows Fiber.scheduler support requires Ruby-3.1+. It is also only partly usable since may ruby IO methods are not yet scheduler aware on Windows. - Add support for pipeline mode of PostgreSQL-14. #401 - Allow specification of multiple hosts in PostgreSQL URI. #387 - Add new method conn.backend_key - used to implement our own cancel method. Type cast enhancements: - Add PG::BasicTypeMapForQueries::BinaryData for encoding of bytea columns. #348 - Reduce time to build coder maps and permit to reuse them for several type maps per PG::BasicTypeRegistry::CoderMapsBundle.new(conn) . #376 - Make BasicTypeRegistry a class and use a global default instance of it. Now a local type registry can be instanciated and given to the type map, to avoid changing shared global states. - Allow PG::BasicTypeMapForQueries to take a Proc as callback for undefined types. Other Enhancements: - Convert all PG classes implemented in C to TypedData objects. #349 - Support ObjectSpace.memsize_of(obj) on all classes implemented in C. #393 - Make all PG objects implemented in C memory moveable and therefore GC.compact friendly. #349 - Update errorcodes and error classes to PostgreSQL-14.0. - Add PG::CONNECTION_* constants for conn.status of newer PostgreSQL versions. - Add better support for logical replication. #339 - Change conn.socket_io to read+write mode and to a BasicSocket object instead of IO. - Use rb_io_wait() and the conn.socket_io object if available for better compatibility to Fiber.scheduler . Fall back to rb_wait_for_single_fd() on ruby < 3.0. - On Windows use a specialized wait function as a workaround for very poor performance of rb_io_wait(). #416 Bugfixes: - Release GVL while calling PQping which is a blocking method, but it didn't release GVL so far. - Fix Connection#transaction to no longer block on interrupts, for instance when pressing Ctrl-C and cancel a running query. #390 - Avoid casting of OIDs to fix compat with Redshift database. #369 - Call conn.block before each conn.get_result call to avoid possible blocking in case of a slow network and multiple query results. - Sporadic Errno::ENOTSOCK when using conn.socket_io on Windows #398 Deprecated: - Add deprecation warning to PG::BasicTypeRegistry.register_type and siblings. Removed: - Remove support of ruby-2.2, 2.3 and 2.4. Minimum is ruby-2.5 now. - Remove support for PostgreSQL-9.2. Minimum is PostgreSQL-9.3 now. - Remove constant PG::REVISION, which was broken since pg-1.1.4. Repository: - Replace Hoe by Bundler for gem packaging - Add Github Actions CI and testing of source and binary gems. == v1.2.3 [2020-03-18] Michael Granger Bugfixes: - Fix possible segfault at `PG::Coder#encode`, `decode` or their implicit calls through a typemap after GC.compact. #327 - Fix possible segfault in `PG::TypeMapByClass` after GC.compact. #328 == v1.2.2 [2020-01-06] Michael Granger Enhancements: - Add a binary gem for Ruby 2.7. == v1.2.1 [2020-01-02] Michael Granger Enhancements: - Added internal API for sequel_pg compatibility. == v1.2.0 [2019-12-20] Michael Granger Repository: - Our primary repository has been moved to Github https://github.com/ged/ruby-pg . Most of the issues from https://bitbucket.org/ged/ruby-pg have been migrated. #43 API enhancements: - Add PG::Result#field_name_type= and siblings to allow symbols to be used as field names. #306 - Add new methods for error reporting: - PG::Connection#set_error_context_visibility - PG::Result#verbose_error_message - PG::Result#result_verbose_error_message (alias) - Update errorcodes and error classes to PostgreSQL-12.0. - New constants: PG_DIAG_SEVERITY_NONLOCALIZED, PQERRORS_SQLSTATE, PQSHOW_CONTEXT_NEVER, PQSHOW_CONTEXT_ERRORS, PQSHOW_CONTEXT_ALWAYS Type cast enhancements: - Add PG::TextEncoder::Record and PG::TextDecoder::Record for en/decoding of Composite Types. #258, #36 - Add PG::BasicTypeRegistry.register_coder to register instances instead of classes. This is useful to register parametrized en/decoders like PG::TextDecoder::Record . - Add PG::BasicTypeMapForQueries#encode_array_as= to switch between various interpretations of ruby arrays. - Add Time, Array