This page centralizes Npgsql's compatibility status with PostgreSQL and other components, and documents some important gotchas.
We aim to be compatible with all currently supported PostgreSQL versions, which means 5 years back. Earlier versions may still work but we don't perform continuous testing on them or commit to resolving issues on them.
Npgsql is an ADO.NET-compatible provider, so it has the same APIs as other .NET database drivers and should behave the same. Please let us know if you notice any non-standard behavior.
.NET Framework/.NET Core/mono
Npgsql 4.* targets .NET Framework 4.6.1, as well as .NET Standard 2.0 which allows it to run on .NET Core. It is also tested and runs well on mono.
Npgsql 5.* targets .NET Standard 2.0 and .NET 5. Starting with this version, we no longer run regression tests on .NET Framework and mono. In addition, the Visual Studio extension (VSIX) and the MSI GAC installer have been discontinued.
Amazon Redshift is a cloud-based data warehouse originally based on PostgreSQL 8.0.2. In addition, due to its nature some features have been removed and others changed in ways that make them incompatible with PostgreSQL. We try to support Redshift as much as we can, please let us know about issues you run across.
First, check out Amazon's page about Redshift and PostgreSQL which contains lots of useful compatibility information.
Additional known issues:
- If you want to connect over SSL, your connection string must contain
Server Compatibility Mode=Redshift, otherwise you'll get a connection error about
- Entity Framework with database-computed identity values don't work with Redshift, since it doesn't support sequences (see issue #544).
DigitalOcean Managed Database
DigitalOcean's Managed Database services requires you to connect to PostgreSQL over SSL. Unfortunately when you enable it in your connection string, you will get the same error regarding
ssl_renegotiation_limit as Amazon Redshift. The Redshift compatibility mode setting resolves the issue on DigitalOcean.
Npgsql works well with PgBouncer, but there are some quirks to be aware of.
- In many cases, you'll want to turn off Npgsql's internal connection pool by specifying
Pooling=falseon the connection string.
- If you decide to keep Npgsql pooling on along with PgBouncer, and are using PgBouncer's transaction or statement mode, then you need to specify
No Reset On Close=trueon the connection string. This disables Npgsql's connection reset logic (
DISCARD ALL), which gets executed when a connection is returned to Npgsql's pool, and which makes no sense in these modes.
- Prior to version 3.1, Npgsql sends the
statement_timeoutstartup parameter when it connects, but this parameter isn't supported by pgbouncer. You can get around this by specifying
CommandTimeout=0on the connection string, and then manually setting the
CommandTimeoutproperty on your
NpgsqlCommandobjects. Version 3.1 no longer sends
- PgBouncer below 1.12 doesn't support SASL authentication.