NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #2344 most downloaded on crates.io
A native, synchronous PostgreSQL client
Last release 3 months ago
12 Jun 2026
Ships fairly regularly
a new release about every 5 months
Some releases are documented
notes for 22 of the last 60 stable releases
2 versions withdrawn
withdrawn after publishing
12 years old
110 releases · first in 2014
Updated tokio-postgres to v0.7.18.
tokio-postgres to v0.7.18.Added Client::execute_typed method.
Client::execute_typed method.Client::query_typed_one and Client::query_typed_opt methods.GenericClient::execute_typed, GenericClient::query_typed_one, and GenericClient::query_typed_opt methods.Transaction::execute_typed, Transaction::query_typed_one, and Transaction::query_typed_opt methods.bit-vec 0.9 via the with-bit-vec-0_9 feature.One column per quarter.
Added Client::check_connection API.
Client::check_connection API.Client::is_closed.futures-util.Added support for bit-vec versions v0.7 and v0.8.
jiff v0.2.bit-vec versions v0.7 and v0.8.rust-postgres organization.Added support for direct TLS negotiation.
cidr 0.3 via the with-cidr-0_3 feature.Added support for jiff 0.1 via the with-jiff-01 feature.
jiff 0.1 via the with-jiff-01 feature.Added {Client, Transaction, GenericClient}::query_typed.
{Client, Transaction, GenericClient}::query_typed.Nothing published for this version
Added support for the hostaddr config option to bypass DNS lookups.
hostaddr config option to bypass DNS lookups.load_balance_hosts config option to randomize connection ordering.user config option now defaults to the executing process's user.Added keepalives_interval and keepalives_retries config options.
keepalives_interval and keepalives_retries config options.tcp_user_timeout config option.RowIter::rows_affected.Added ToSql and FromSql implementations for [u8; N] via the array-impls feature.
ToSql and FromSql implementations for [u8; N] via the array-impls feature.smol_str 0.1 via the with-smol_str-01 feature.ToSql::encode_format to support text encodings of parameters.Added support for uuid 1.0 via the with-uuid-1 feature.
uuid 1.0 via the with-uuid-1 feature.Added support for eui48 1.0 via the with-eui48-1 feature.
SimpleQueryRow::columns.eui48 1.0 via the with-eui48-1 feature.FromSql and ToSql implementations for arrays via the array-impls feature.time 0.3 via the with-time-0_3 feature.Added support for geo-types 0.7 via with-geo-types-0_7 feature.
geo-types 0.7 via with-geo-types-0_7 feature.Client::clear_type_cache.Upgraded to tokio-postgres 0.7.
tokio-postgres 0.7.ToSql values can now take both &dyn ToSql and T: ToSql values.Client::is_valid which can be used to check that the connection is still alive with a
timeout.Restored the Send implementation for Client.
Send implementation for Client.Upgraded to tokio-postgres 0.6.
tokio-postgres 0.6.Config::notice_callback, which can be used to provide a custom callback for notices.Fixed transactions to roll back immediately on drop.
Added support for geo-types 0.6.
geo-types 0.6.Errors sent by the server will now be returned from Client methods rather than just being logged.
Client methods rather than just being logged.Transaction::savepoint, which can be used to create a savepoint with a custom name.Client::notifications, which returns an interface to the notifications sent by the server.Added Debug implementations for Client, Row, and Column.
Debug implementations for Client, Row, and Column.time 0.2 support.Added Client::build_transaction to allow configuration of various transaction options.
Client::build_transaction to allow configuration of various transaction options.Client::cancel_token, which returns a separate owned object that can be used to cancel queries.Config fields.GenericClient trait implemented for Client and Transaction and covering shared functionality.Each Client now has its own non-threaded tokio Runtime rather than sharing a global threaded Runtime. This significantly improves performance by minim
Client now has its own non-threaded tokio Runtime rather than sharing a global threaded Runtime. This
significantly improves performance by minimizing context switches and cross-thread synchronization.Client::copy_in now returns a writer rather than taking in a reader.Client::query_raw now returns a named type.Client::copy_in and Client::copy_out no longer take query parameters as PostgreSQL doesn't support them in COPY
queries.uuid 0.7.Client::query_opt for queries that are expected to return zero or one rows.binary_copy module.fallible-iterator crate is now publicly reexported.Changed Config::executor to Config::spawner.
Config::executor to Config::spawner.uuid 0.8.Transaction::query_one.Updated tokio-postgres to 0.5.0-alpha.1.
tokio-postgres to 0.5.0-alpha.1.### Fixed * Documentation fixes
Connection has been renamed to Client.
Connection has been renamed to Client.
The Client type is now a thin wrapper around the tokio-postgres nonblocking client. By default, this is handled
transparently by spawning connections onto an internal tokio Runtime, but this can also be controlled explicitly.
The ConnectParams type and IntoConnectParams trait have been replaced by a builder-style Config type.
Before:
let params = ConnectParams::builder()
.user("postgres", None)
.build(Host::Tcp("localhost".to_string()))
.build();
let conn = Connection::connect(params, &TlsMode::None)?;
After:
let client = Client::configure()
.user("postgres")
.host("localhost")
.connect(NoTls)?;
The TLS connection mode (e.g. prefer) is now part of the connection configuration instead of being passed in
separately.
Before:
let conn = Connection::connect("postgres://postgres@localhost", &TlsMode::Prefer(connector))?;
After:
let client = Client::connect("postgres://postgres@localhost?sslmode=prefer", connector)?;
Client and Transaction methods take &mut self rather than &self, and correct use of the active transaction is
verified at compile time rather than runtime.
Row no longer borrows any data.
Statement is now a "token" which is passed into methods on Client and Transaction and does not borrow the
client:
Before:
let statement = conn.prepare("SELECT * FROM foo WHERE bar = $1")?;
let rows = statement.query(&[&1i32])?;
After:
let statement = client.prepare("SELECT * FROM foo WHERE bar = $1")?;
let rows = client.query(&statement, &[1i32])?;
Statement::lazy_query has been replaced with Transaction::bind, which returns a Portal type that can be used
with Transaction::query_portal.
Statement::copy_in and Statement::copy_out have been moved to Client and Transaction.
Client::copy_out and Transaction::copy_out now return a Reader rather than consuming in a Writer.
Connection::batch_execute and Transaction::batch_execute have been replaced with Client::simple_query and
Transaction::simple_query.
The Cargo features enabling ToSql and FromSql implementations for external crates are now versioned. For example,
with-uuid is now with-uuid-0_7. This enables us to add support for new major versions of the crates in parallel
without breaking backwards compatibility.
FromSql implementations can now borrow from the data buffer. In particular, this means that you can deserialize
values as &str. The FromSqlOwned trait can be used as a bound to restrict code to deserializing owned values.with-openssl and with-native-tls Cargo features have been removed. Use the tokio-postgres-openssl and
tokio-postgres-native-tls crates instead.with-rustc_serialize and with-time Cargo features have been removed. Use serde and SystemTime or chrono
instead.Transaction::set_commit and Transaction::set_rollback methods have been removed. The only way to commit a
transaction is to explicitly consume it via Transaction::commit.Rows type has been removed; methods now return Vec<Row> instead.Connection::prepare_cache has been removed, as Statement is now 'static and can be more easily cached
externally.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →