- Backwards incompatible changes
- Invoke
encode_to_iodata!
instead ofencode!
in JSON encoder - Remove Postgrex.CIDR and use Postgrex.INET to encode both inet/cidr (as Postgres may perform implicit/explicit casting at any time)
- Postgrex.Time, Postgrex.Date and Postgrex.Timestamp were deprecated and now have been effectively removed
- Invoke
-
Enhancements
- Reload types on unknown oid during prepare
-
Bug fixes
- Fix default timeout for connection process from 5000s to 15000s
- Bug fixes
- Do not build invalid dates at compilation time on Elixir master
-
Enhancements
- Allow naming Postgrex.Notifications server
- Provide tsvector and lexeme support using binary formats
-
Bug fixes
- Fix encoding of Decimal values that would be wrong in certain circumstances
- Add
:crypto
to applications - Specify proper Elixir dependency
- Restore compatibility with postgres versions prior to 8.4 and with redshift
-
Enchancements
- Support built-in geometry types
- Fallback to
PGDATABASE
system env for the database - Support
bit
andvarbit
types - Add postgres error code to error messages
- Support unprepared when using a stream
:connect_timeout
and:handshake_timeout
to configure tcp connect and handshake timeouts- Improve numeric encode/decode
-
Bug fixes
- Quote channel on listen/unlisten
- Check datetime structs available before defining calendar extension
- Backoff all awaiting connections if a bootstrap fails to prevent timeout loop
- Handle idle admin shutdown of postgres backend
- Fix rebootstrap query to be O(Nlog(N)) instead of O(N^2)
- Fix encoding of numerical values
-
Backwards incompatible changes
:copy_data
query option is no longer supported and data can only be copied to the database using a collectable- Query struct has removed encoders/decoders and changed param_info/result_info values
- Extensions now use a new encoder/decoder API based on quoted expressions
- The
:extensions
,:decode_binary
and:null
options instart_link
are no longer supported in favor of defining custom types withPostgrex.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.
-
Enchancements
- Support special "char" type
-
Bug fixes
- Limit re-bootstrap to one connection at a time
- Fix re-bootstrap of new composite types that use old types
- Enhancements
- Raise DBConnection.ConnectionError on connection error
- Use send encoding to determine citext encoding
- Use Map in favor of deprecated modules (to avoid warnings on v1.4)
- Run rebootstrap test synchronously on every connect
- Add support for Elixir 1.3+ Calendar types
-
Enhancements
- Add support for COPY TO STDOUT and COPY FROM STDIN
- Support packets bigger than 64MB
- Introduce
mode: :savepoint
for prepare/execute/close that allows wrapping a request in a savepoint so that an error does not fail the transaction - Introduce streaming queries
- Add
:decode_binary
option which is either:copy
(default) or:reference
.
-
Bug fixes
- Consistently convert the port number to integer
- Remove type server entry on disconnect
-
Enhancements
- Support PgBouncer transaction/statement pooling
- Include more information in error messages
- Add support for built-in postgres point type
- Add
Postgrex.child_spec/1
- Allow custom encoding/decoding of postgres' NULL on a per query basis
-
Bug fixes
- Correctly pad decimal digits during encoding
-
Enhancements
- 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
- Rely on DBConnection. This means better performance by copying less data between processes, faster encoding/decoding, support for transactions,
-
Backwards incompatible change
- Connection API from
Postgrex.Connection
has been moved toPostgrex
- Notifications API from
Postgrex.Connection
has been moved toPostgrex.Notifications
- Connection API from
-
Enhancements
- Improve error message on encoding/decoding failures
- Add network types such as:
inet
,cidr
andmacaddr
- Improve TCP error messages
- Support
PGPORT
environment variable - Improve decoding performance by caching extension information
- Improve query performance by decoding in the client process hence not blocking the connection
- Raise if number of parameters to query is wrong
-
Bug fixes
- Correctly handle errors in connection initialization with
sync_connect: true
- Do not fail on custom error codes
- Correctly handle large number of parameters, also fixes some protocol issues where unsigned integers were treated as signed
- Correctly handle errors in connection initialization with
- Enhancements
- Revert client side decoding as affects performance negatively (around 15% slower)
- Cast floats and integers to decimal if a decimal is requested
-
Enhancements
- Cached type bootstrapping for less memory usage and faster connection set up
- The result set is now decoded in the calling process to reduce time spent in the connection process
- Add a
decode: :manual
option toPostgrex.query/4
and the functionPostgrex.decode/2
for manually decoding the result - Add
:sync_connect
option toPostgrex.start_link/1
-
Bug fixes
- Correctly handle extension types created inside schemas
-
Backwards incompatible changes
- Each row in
Postgrex.Result.rows
is now a list of columns instead of a tuple
- Each row in
- Bug fixes
- Fix version detection
- Enhancements
- Add
Postgrex.Extensions.JSON
extension forjson
andjsonb
types - Set suitable TCP buffer size automatically
- Add
-
Enhancements
- Add
:socket_options
option toPostgrex.start_link/1
- Improved performance regarding binary handling
- Add hstore support
- Add
-
Backwards incompatible changes
- Remove
:async_connect
option and make it the default
- Remove
-
Enhancements
- Keep the postgres error code in
:pg_code
- Support oid types and all its aliases (regclass etc)
- Keep the postgres error code in
-
Backwards incompatible changes
- Rename
:msec
field to:usec
onPostgrex.Time
andPostgrex.Timestamp
- Rename
-
Bug fixes
- Fix numeric encoding for fractional numbers with less digits than the numeric base
- Support encoding
timetz
type - Fix time and timestamp off-by-one bounds
-
Enhancements
- Add extensions
- Encode/decode ranges generically
- Add bounds when encoding integer types to error instead of overflowing the integer
- Log unhandled Postgres errors (when it cant be replied to anyone)
- Add support for enum types
- Add support for citext type
- Add microseconds to times and timestamps
- Add the ability to rebootstrap types for an open connection
-
Backwards incompatible changes
- Remove the support for type-hinted queries
- Remove encoder, decoder and formatter functions, use extensions instead
- Use structs for dates, times, timestamps, interval and ranges
- Change the default timeout for all operations to 5000ms
- Show Postgres error codes as their names instead
-
Enhancements
- Add asynchronous notifications through
listen
andunlisten
- Add support for range types
- Add support for uuid type
- Add
:async_connect
option tostart_link/1
- Add asynchronous notifications through
-
Bug fixes
- Fix encoding
nil
values in arrays and composite types
- Fix encoding
-
Enhancements
- Queries can be constructed of
iodata
- Support "type hinted" queries to save one client-server round trip which will reduce query latency
- Queries can be constructed of
-
Backwards incompatible changes
Postgrex.Error
postgres
field is converted from keyword list to mapPostgrex.Connect.query
params
parameter is no longer optional (pass an empty list if query has no parameters)- The
timeout
parameter for all functions have been moved to a keyword list with the key:timeout
- Enhancements
- Reduce the amount of intermediary binaries constructed with the help of
iodata
- Reduce the amount of intermediary binaries constructed with the help of
- Backwards incompatible changes
Postgrex.Error
exception converted to struct
- Backwards incompatible changes
Postgrex.Result
andPostgrex.TypeInfo
converted to structs
- Enhancements
- 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
- Add automatic fallback to environment variables
PGUSER
,PGHOST
andPGPASS
- Enhancements
- Numerics decode and encode to Decimal
- Enhancements
- Compact state before printing to logs and hide password
- Concurrency support, safe to use connection from multiple processes concurrently
-
Bug fixes
- Don't try to decode values of text format
-
Backwards incompatible changes
- Types are stored as binaries instead of atoms, update your custom encoders and decoders
-
Enhancements
- Add support for SSL
-
Bug fixes
- Fix decoding of unknown type when using custom decoder
-
Enhancements
- Floats handles NaN, inf and -inf
- Add support for numerics
- Custom encoders and decoders works on elements in arrays
- Add support for composite types
- Add functions that raise on error
-
Bug fixes
- INSERT query works with extended query parameters
- Return proper
num_rows
on PostgreSQL 8.4 - Fix race condition
-
Backwards incompatible changes
- Simplify custom decoding and encoding with default function
First release!