CHANGELOG.md (15779B)
1 # Changelog 2 3 ## v0.16.5 (2022-09-20) 4 5 * Enhancements 6 * Allow the `:search_path` to be set for new connections 7 8 ## v0.16.4 (2022-07-29) 9 10 * Enhancements 11 * Support Unix sockets in hostname and PGHOST 12 * Support infinity value on numerics/decimals (PG14+) 13 * Add count to Table.Reader metadata 14 * Fix warnings on Elixir v1.15 15 16 ## v0.16.3 (2022-04-27) 17 18 * Enhancements 19 * Implement the Table.Reader protocol for query result 20 21 ## v0.16.2 (2022-02-21) 22 23 * Enhancements 24 * Add `:ping_timeout` start option 25 26 * Bug fixes 27 * Replication streaming can be resumed after reconnect 28 29 ## v0.16.1 (2022-01-24) 30 31 * Bug fixes 32 * Fix inconsistent return type for multiple queries in `Postgrex.SimpleConnection` and `Postgrex.ReplicationConnection`. Instead always wrap `Postgrex.Result` in a list. 33 34 ## v0.16.0 (2022-01-23) 35 36 Require Elixir v1.11+. 37 38 * Enhancements 39 * Support negative years for date, timestamp and timestampz types 40 * Add `Postgrex.SimpleConnection` and `Postgrex.ReplicationConnection` 41 * Bug fixes 42 * Cancel any pending requests before closing the socket 43 * Fix possible crash on getting default opts when PGPORT is invalid but a port is given 44 45 ## v0.15.11 (2021-09-26) 46 47 * Enhancements 48 * Support `xid8` type introduced in PostgreSQL 13 49 50 ## v0.15.10 (2021-07-27) 51 52 * Enhancements 53 * Define child_spec for Postgrex.Notifications 54 * Improve error handling when using multiple endpoints 55 * Bug fixes 56 * Fix dialyzer warnings 57 * Fix invalid type error after failover 58 59 ## v0.15.9 (2021-04-24) 60 61 * Enhancements 62 * Support the new `:endpoints` and `:target_server_type` to make it faster to rotate across multiple instances in cases of failovers 63 * Bug fixes 64 * Do not warn on undefined JSON library 65 * Fix bug when a message which is not a row description, data row, command completion or error message occurs and there is buffer remaining to be processed 66 67 ## v0.15.8 (2021-01-19) 68 69 * Bug fixes 70 * Make sure scram authentication method works on Erlang/OTP 24 71 72 ## v0.15.7 (2020-10-17) 73 74 * Enhancements 75 * Add `compare` and `to_string` to `Postgrex.Interval` 76 * Bug fixes 77 * Allow deallocated queries to be re-prepared 78 79 ## v0.15.6 (2020-09-21) 80 81 * Enhancements 82 * Support Decimal 2.0 83 * Bug fixes 84 * Do not keep credentials in state in `Postgrex.Notifications` 85 86 ## v0.15.5 (2020-06-03) 87 88 * Enhancements 89 * Support optional decoding of infinite timestamps 90 * Bug fixes 91 * Remove cache statements that cannot be described from cache when on a savepoint transaction (such as when inside the SQL sandbox) 92 93 ## v0.15.4 (2020-05-09) 94 95 * Enhancements 96 * Fix warnings on Elixir v1.11.0-dev 97 98 ## v0.15.3 (2019-12-11) 99 100 * Enhancements 101 * Allow dynamic connection configuration with the `:configure` for notifications 102 * Add `:auto_reconnect` option for notifications 103 * Accept `listen` commands even if the notifications connection is down or yet to first connect 104 105 * Bug fixes 106 * Encode empty arrays in a mechanism compatible with CockroachDB 107 * Cleanly terminate connection started with a socket 108 109 ## v0.15.2 (2019-10-08) 110 111 * Enhancements 112 * Improve performance of the bootstrap query 113 114 ## v0.15.1 (2019-09-16) 115 116 * Enhancements 117 * Add support for microseconds in Postgrex.Interval 118 * Reduce bootstrap log message to debug and clarify error message 119 120 ## v0.15.0 (2019-07-18) 121 122 Postgrex v0.15+ requires Elixir v1.6+. 123 124 * Enhancements 125 * Filter bootstrap more efficiently by avoiding loading tables information on startup 126 * Only bootstrap new oids during describe: this means reconnects don't run a bootstrap 127 query and describe runs minimal query 128 * Parse Postgrex 12beta new version format 129 * Raise error when :ssl is required and not started in child_spec/1 130 131 * Bug fixes 132 * Don't encode DateTime, NaiveDateTime or Time unless Calendar.ISO 133 134 ## v0.14.3 (2019-05-08) 135 136 * Enhancements 137 * Make bootstrap query compatible with CockroachDB 19.1 138 * Improve error message when encoding bad tuple 139 140 ## v0.14.2 (2019-04-12) 141 142 * Bug fixes 143 * Fix Elixir deprecation warnings 144 * Do not crash when receiving notices during authentication 145 * Do not crash when receiving an error (caused by a raise) during query execution 146 147 ## v0.14.1 (2018-11-24) 148 149 * Bug fixes 150 * Bump decimal dependency to avoid runtime warnings 151 152 ## v0.14.0 (2018-10-29) 153 154 * Enhancements 155 * Postgrex.INET will add a /32 netmask to an IPv4 address and a /128 netmask to an IPv6 address during encoding where `netmask: nil`. When decoding, a /32 netmask (for IPv4) or /128 netmask (for IPv6) will be removed, resulting in `netmask: nil` for the struct 156 * Add `:disconnect_on_error_codes` which allows Postgrex to automatically disconnect and then reconnect on certain errors. This is useful when using Postgrex against systems that support failover, which would emit certain errors on failover. This change allow those errors to be recovered from transparently 157 * Add `:cache_statement` to `Postgrex.query/4` as a built-in statement cache 158 * Support scram-sha-256 authentication from PostgreSQL 10 159 * Add `Postgrex.prepare_execute/4` 160 * Automatically re-prepare queries that failed to encode due to a database type change 161 162 * Backwards incompatible changes 163 * Invoke `encode_to_iodata!` instead of `encode!` in JSON encoder 164 * Remove Postgrex.CIDR and use Postgrex.INET to encode both inet/cidr (as PostgreSQL may perform implicit/explicit casting at any time) 165 * Postgrex.Time, Postgrex.Date and Postgrex.Timestamp were deprecated and now have been effectively removed 166 * `Postgrex.execute/4` now always returns the prepared query 167 * `:pool_timeout` is removed in favor of `:queue_target` and `:queue_interval`. See `DBConnection.start_link/2` for more information 168 169 ## v0.13.4 (2018-01-25) 170 171 * Enhancements 172 * Support custom range domains 173 * Support custom array domains 174 * Add support for UNIX domain sockets via the `:socket_dir` option 175 * Remove warnings on Elixir v1.6 176 177 * Bug fixes 178 * Fix encoding of empty ranges 179 * Fix Postgrex.Path open/closed byte parity 180 181 ## v0.13.3 (2017-05-31) 182 183 * Enhancements 184 * Reload types on unknown oid during prepare 185 186 * Bug fixes 187 * Fix default timeout for connection process from 5000s to 15000s 188 189 ## v0.13.2 (2017-03-05) 190 191 * Bug fixes 192 * Do not build invalid dates at compilation time on Elixir master 193 194 ## v0.13.1 (2017-02-20) 195 196 * Enhancements 197 * Allow naming Postgrex.Notifications server 198 * Provide tsvector and lexeme support using binary formats 199 200 * Bug fixes 201 * Fix encoding of Decimal values that would be wrong in certain circumstances 202 * Add `:crypto` to applications 203 * Specify proper Elixir dependency 204 * Restore compatibility with postgres versions prior to 8.4 and with redshift 205 206 ## v0.13.0 (2016-12-17) 207 208 * Enhancements 209 * Support built-in geometry types 210 * Fallback to `PGDATABASE` system env for the database 211 * Support `bit` and `varbit` types 212 * Add postgres error code to error messages 213 * Support unprepared when using a stream 214 * `:connect_timeout` and `:handshake_timeout` to configure TCP connect and handshake timeouts 215 * Improve numeric encode/decode 216 217 * Bug fixes 218 * Quote channel on listen/unlisten 219 * Check datetime structs available before defining calendar extension 220 * Backoff all awaiting connections if a bootstrap fails to prevent timeout loop 221 * Handle idle admin shutdown of postgres backend 222 * Fix rebootstrap query to be O(Nlog(N)) instead of O(N^2) 223 * Fix encoding of numerical values 224 225 * Backwards incompatible changes 226 * `:copy_data` query option is no longer supported and data can only be copied to the database using a collectable 227 * Query struct has removed encoders/decoders and changed param_info/result_info values 228 * Extensions now use a new encoder/decoder API based on quoted expressions 229 * The `:extensions`, `:decode_binary` and `:null` options in `start_link` are no longer supported in favor of defining custom types with `Postgrex.Types.define(module, extra_extensions, options)`. `Postgrex.Types.define/3` must be called on its own file, outside of any module and function, as it only needs to be defined once during compilation. 230 231 ## v0.12.1 (2016-09-29) 232 233 * Enhancements 234 * Support special "char" type 235 236 * Bug fixes 237 * Limit re-bootstrap to one connection at a time 238 * Fix re-bootstrap of new composite types that use old types 239 240 ## v0.12.0 (2016-09-06) 241 242 * Enhancements 243 * Raise DBConnection.ConnectionError on connection error 244 * Use send encoding to determine citext encoding 245 * Use Map in favor of deprecated modules (to avoid warnings on v1.4) 246 * Run rebootstrap test synchronously on every connect 247 * Add support for Elixir 1.3+ Calendar types 248 249 ## v0.11.2 (2016-06-16) 250 251 * Enhancements 252 * Add support for COPY TO STDOUT and COPY FROM STDIN 253 * Support packets bigger than 64MB 254 * Introduce `mode: :savepoint` for prepare/execute/close that allows wrapping a request in a savepoint so that an error does not fail the transaction 255 * Introduce streaming queries 256 * Add `:decode_binary` option which is either `:copy` (default) or `:reference`. 257 258 * Bug fixes 259 * Consistently convert the port number to integer 260 * Remove type server entry on disconnect 261 262 ## v0.11.1 (2016-02-15) 263 264 * Enhancements 265 * Support PgBouncer transaction/statement pooling 266 * Include more information in error messages 267 * Add support for built-in postgres point type 268 * Add `Postgrex.child_spec/1` 269 * Allow custom encoding/decoding of postgres' NULL on a per query basis 270 271 * Bug fixes 272 * Correctly pad decimal digits during encoding 273 274 ## v0.11.0 (2016-01-21) 275 276 * Enhancements 277 * Rely on DBConnection. This means better performance by copying less data between processes, faster encoding/decoding, support for transactions, `after_connect` hooks, connection backoff, logging, prepared queries, the ability to use both Poolboy and Sojourn as pools out of the box, and more 278 279 * Backwards incompatible change 280 * Connection API from `Postgrex.Connection` has been moved to `Postgrex` 281 * Notifications API from `Postgrex.Connection` has been moved to `Postgrex.Notifications` 282 283 ## v0.10.0 (2015-11-17) 284 285 * Enhancements 286 * Improve error message on encoding/decoding failures 287 * Add network types such as: `inet`, `cidr` and `macaddr` 288 * Improve TCP error messages 289 * Support `PGPORT` environment variable 290 * Improve decoding performance by caching extension information 291 * Improve query performance by decoding in the client process hence not blocking the connection 292 * Raise if number of parameters to query is wrong 293 294 * Bug fixes 295 * Correctly handle errors in connection initialization with `sync_connect: true` 296 * Do not fail on custom error codes 297 * Correctly handle large number of parameters, also fixes some protocol issues where unsigned integers were treated as signed 298 299 ## v0.9.1 (2015-07-14) 300 301 * Enhancements 302 * Revert client side decoding as affects performance negatively (around 15% slower) 303 * Cast floats and integers to decimal if a decimal is requested 304 305 ## v0.9.0 (2015-07-12) 306 307 * Enhancements 308 * Cached type bootstrapping for less memory usage and faster connection set up 309 * The result set is now decoded in the calling process to reduce time spent in the connection process 310 * Add a `decode: :manual` option to `Postgrex.query/4` and the function `Postgrex.decode/2` for manually decoding the result 311 * Add `:sync_connect` option to `Postgrex.start_link/1` 312 313 * Bug fixes 314 * Correctly handle extension types created inside schemas 315 316 * Backwards incompatible changes 317 * Each row in `Postgrex.Result.rows` is now a list of columns instead of a tuple 318 319 ## v0.8.4 (2015-06-24) 320 321 * Bug fixes 322 * Fix version detection 323 324 ## v0.8.3 (2015-06-22) 325 326 * Enhancements 327 * Add `Postgrex.Extensions.JSON` extension for `json` and `jsonb` types 328 * Set suitable TCP buffer size automatically 329 330 ## v0.8.2 (2015-06-01) 331 332 * Enhancements 333 * Add `:socket_options` option to `Postgrex.start_link/1` 334 * Improved performance regarding binary handling 335 * Add hstore support 336 337 * Backwards incompatible changes 338 * Remove `:async_connect` option and make it the default 339 340 ## v0.8.1 (2015-04-09) 341 342 * Enhancements 343 * Keep the postgres error code in `:pg_code` 344 * Support oid types and all its aliases (regclass etc) 345 346 * Backwards incompatible changes 347 * Rename `:msec` field to `:usec` on `Postgrex.Time` and `Postgrex.Timestamp` 348 349 * Bug fixes 350 * Fix numeric encoding for fractional numbers with less digits than the numeric base 351 * Support encoding `timetz` type 352 * Fix time and timestamp off-by-one bounds 353 354 ## v0.8.0 (2015-02-26) 355 356 * Enhancements 357 * Add extensions 358 * Encode/decode ranges generically 359 * Add bounds when encoding integer types to error instead of overflowing the integer 360 * Log unhandled PostgreSQL errors (when it cant be replied to anyone) 361 * Add support for enum types 362 * Add support for citext type 363 * Add microseconds to times and timestamps 364 * Add the ability to rebootstrap types for an open connection 365 366 * Backwards incompatible changes 367 * Remove the support for type-hinted queries 368 * Remove encoder, decoder and formatter functions, use extensions instead 369 * Use structs for dates, times, timestamps, interval and ranges 370 * Change the default timeout for all operations to 5000ms 371 * Show PostgreSQL error codes as their names instead 372 373 ## v0.7.0 (2015-01-20) 374 375 * Enhancements 376 * Add asynchronous notifications through `listen` and `unlisten` 377 * Add support for range types 378 * Add support for uuid type 379 * Add `:async_connect` option to `start_link/1` 380 381 * Bug fixes 382 * Fix encoding `nil` values in arrays and composite types 383 384 ## v0.6.0 (2014-09-07) 385 386 * Enhancements 387 * Queries can be constructed of `iodata` 388 * Support "type hinted" queries to save one client-server round trip which will reduce query latency 389 390 * Backwards incompatible changes 391 * `Postgrex.Error` `postgres` field is converted from keyword list to map 392 * `Postgrex.Connect.query` `params` parameter is no longer optional (pass an empty list if query has no parameters) 393 * The `timeout` parameter for all functions have been moved to a keyword list with the key `:timeout` 394 395 ## v0.5.5 (2014-08-20) 396 397 * Enhancements 398 * Reduce the amount of intermediary binaries constructed with the help of `iodata` 399 400 ## v0.5.4 (2014-08-04) 401 402 ## v0.5.3 (2014-07-13) 403 404 ## v0.5.2 (2014-06-18) 405 406 ## v0.5.1 (2014-05-24) 407 408 * Backwards incompatible changes 409 * `Postgrex.Error` exception converted to struct 410 411 ## v0.5.0 (2014-05-01) 412 413 * Backwards incompatible changes 414 * `Postgrex.Result` and `Postgrex.TypeInfo` converted to structs 415 416 ## v0.4.2 (2014-04-21) 417 418 * Enhancements 419 * Add timeouts to all synchronous calls. When a timeout is hit an exit error will be raised in the caller process and the connection process will exit 420 * Add automatic fallback to environment variables `PGUSER`, `PGHOST` and `PGPASSWORD` 421 422 ## v0.4.0 (2014-01-16) 423 424 * Enhancements 425 * Numerics decode and encode to Decimal 426 427 ## v0.3.1 (2014-01-15) 428 429 * Enhancements 430 * Compact state before printing to logs and hide password 431 * Concurrency support, safe to use connection from multiple processes concurrently 432 433 ## v0.3.0 (2013-12-16) 434 435 * Bug fixes 436 * Don't try to decode values of text format 437 438 * Backwards incompatible changes 439 * Types are stored as binaries instead of atoms, update your custom encoders and decoders 440 441 ## v0.2.1 (2013-12-10) 442 443 * Enhancements 444 * Add support for SSL 445 446 * Bug fixes 447 * Fix decoding of unknown type when using custom decoder 448 449 ## v0.2.0 (2013-11-14) 450 451 * Enhancements 452 * Floats handles NaN, inf and -inf 453 * Add support for numerics 454 * Custom encoders and decoders works on elements in arrays 455 * Add support for composite types 456 * Add functions that raise on error 457 458 * Bug fixes 459 * INSERT query works with extended query parameters 460 * Return proper `num_rows` on PostgreSQL 8.4 461 * Fix race condition 462 463 * Backwards incompatible changes 464 * Simplify custom decoding and encoding with default function 465 466 ## v0.1.0 (2013-10-14) 467 468 First release!