# Compatibility Notes

This page centralizes Npgsql's compatibility status with PostgreSQL and other components, and documents some important gotchas.

## PostgreSQL

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.

## ADO.NET

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.

## NativeAOT and trimming

NativeAOT allows using ahead-of-time compilation to publish a fully self-contained application that has been compiled to native code. Native AOT apps have faster startup time and smaller memory footprints, and thanks to trimming can also have a much smaller size footprint on disk.

Starting with version 8.0, Npgsql is fully compatible with NativeAOT and trimming. The majority of features are compatible with NativeAOT/trimming and can be used without issues, and most applications using Npgsql can be used as-is with NativeAOT/trimming without any changes. A few features which are incompatible require an explicit code opt-in, which generates a warning if used with NativeAOT/trimming enabled.

## .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.

## pgbouncer

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=false` on 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=true` on 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_timeout` startup parameter when it connects, but this parameter isn't supported by pgbouncer. You can get around this by specifying `CommandTimeout=0` on the connection string, and then manually setting the `CommandTimeout` property on your `NpgsqlCommand` objects. Version 3.1 no longer sends `statement_timeout`.
- PgBouncer below 1.12 doesn't support SASL authentication.

## Amazon Redshift

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 `ssl_renegotiation_limit`.
- 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.