Npgsql 10.0.1

Npgsql is the open source .NET data provider for PostgreSQL. It allows you to connect and interact with PostgreSQL server using .NET.

Quickstart

Here's a basic code snippet to get you started:

var connString = "Host=myserver;Username=mylogin;Password=mypass;Database=mydatabase";

await using var conn = new NpgsqlConnection(connString);
await conn.OpenAsync();

// Insert some data
await using (var cmd = new NpgsqlCommand("INSERT INTO data (some_field) VALUES (@p)", conn))
{
    cmd.Parameters.AddWithValue("p", "Hello world");
    await cmd.ExecuteNonQueryAsync();
}

// Retrieve all rows
await using (var cmd = new NpgsqlCommand("SELECT some_field FROM data", conn))
await using (var reader = await cmd.ExecuteReaderAsync())
{
while (await reader.ReadAsync())
    Console.WriteLine(reader.GetString(0));
}

Key features

  • High-performance PostgreSQL driver. Regularly figures in the top contenders on the TechEmpower Web Framework Benchmarks.
  • Full support of most PostgreSQL types, including advanced ones such as arrays, enums, ranges, multiranges, composites, JSON, PostGIS and others.
  • Highly-efficient bulk import/export API.
  • Failover, load balancing and general multi-host support.
  • Great integration with Entity Framework Core via Npgsql.EntityFrameworkCore.PostgreSQL.

For the full documentation, please visit the Npgsql website.

Showing the top 20 packages that depend on Npgsql.

Packages Downloads
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
57
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
39
Npgsql.LegacyPostgis
PostGIS plugin for Npgsql, allowing mapping of PostGIS types to the legacy types (e.g. PostgisPoint).
24
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
21
Npgsql.LegacyPostgis
PostGIS plugin for Npgsql, allowing mapping of PostGIS types to the legacy types (e.g. PostgisPoint).
20
Npgsql.LegacyPostgis
PostGIS plugin for Npgsql, allowing mapping of PostGIS types to the legacy types (e.g. PostgisPoint).
19
Npgsql.LegacyPostgis
PostGIS plugin for Npgsql, allowing mapping of PostGIS types to the legacy types (e.g. PostgisPoint).
18
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
16
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
15
AspNetCore.HealthChecks.NpgSql
HealthChecks.NpgSql is a health check for Postgress Sql.
15
TestContainers
Package Description
15
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
14
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
14
Npgsql.EntityFrameworkCore.PostgreSQL
Npgsql.EntityFrameworkCore.PostgreSQL
14

Version Downloads Last updated
10.0.1 4 12/21/2025
10.0.0 4 11/24/2025
10.0.0-rc.1 6 10/7/2025
9.0.4 6 10/7/2025
9.0.3 4 6/7/2025
9.0.2 5 6/12/2025
9.0.1 3 6/13/2025
8.0.8 7 10/7/2025
8.0.7 4 6/7/2025
8.0.6 7 6/7/2025
8.0.5 3 6/7/2025
8.0.4 5 6/7/2025
8.0.3 3 6/7/2025
8.0.2 5 6/12/2025
8.0.1 3 6/12/2025
8.0.0 3 6/7/2025
8.0.0-rc.2 4 6/7/2025
8.0.0-preview.4 5 6/7/2025
8.0.0-preview.3 9 6/7/2025
8.0.0-preview.2 5 6/7/2025
8.0.0-preview.1 4 6/7/2025
7.0.10 2 6/7/2025
7.0.9 4 6/7/2025
7.0.8 4 6/7/2025
7.0.7 3 6/16/2025
7.0.6 2 6/15/2025
7.0.4 4 6/7/2025
7.0.2 4 6/12/2025
7.0.1 5 6/12/2025
7.0.0 4 6/14/2025
7.0.0-rc.2 2 6/7/2025
7.0.0-rc.1 6 6/13/2025
7.0.0-preview.7 2 6/21/2025
7.0.0-preview.6 3 6/7/2025
7.0.0-preview.5 5 6/7/2025
7.0.0-preview.4 6 6/7/2025
7.0.0-preview.3 3 6/7/2025
7.0.0-preview.2 5 6/7/2025
7.0.0-preview.1 5 6/7/2025
6.0.13 4 6/7/2025
6.0.12 4 6/16/2025
6.0.11 3 6/7/2025
6.0.10 3 6/7/2025
6.0.9 6 6/7/2025
6.0.8 2 6/7/2025
6.0.7 4 6/7/2025
6.0.6 3 6/7/2025
6.0.5 3 6/7/2025
6.0.4 6 6/7/2025
6.0.3 5 6/7/2025
6.0.2 5 6/12/2025
6.0.1 3 6/12/2025
6.0.0 2 6/12/2025
6.0.0-rc.2 11 6/7/2025
6.0.0-rc.1 11 6/8/2025
6.0.0-preview7 13 6/7/2025
6.0.0-preview6 12 6/7/2025
6.0.0-preview5 11 6/7/2025
6.0.0-preview4 12 6/7/2025
6.0.0-preview3 15 6/7/2025
6.0.0-preview2 12 6/7/2025
5.0.18 12 6/7/2025
5.0.17 11 6/7/2025
5.0.16 11 6/7/2025
5.0.15 12 6/7/2025
5.0.14 14 6/7/2025
5.0.13 11 6/7/2025
5.0.12 11 6/7/2025
5.0.11 11 6/7/2025
5.0.10 12 6/7/2025
5.0.7 14 6/7/2025
5.0.5 12 6/7/2025
5.0.4 13 6/7/2025
5.0.3 13 6/7/2025
5.0.2 13 6/7/2025
5.0.1.1 12 6/7/2025
5.0.0 11 6/8/2025
4.1.14 12 6/7/2025
4.1.13 12 6/7/2025
4.1.12 10 6/7/2025
4.1.11 11 6/7/2025
4.1.10 12 6/7/2025
4.1.9 20 6/7/2025
4.1.8 11 6/8/2025
4.1.7 11 6/7/2025
4.1.6 14 6/7/2025
4.1.5 11 6/6/2025
4.1.4 11 6/8/2025
4.1.3.1 12 6/7/2025
4.1.3 11 6/8/2025
4.1.2 12 6/8/2025
4.1.1 11 6/7/2025
4.1.0 10 6/7/2025
4.0.17 13 6/7/2025
4.0.16 11 6/7/2025
4.0.14 11 6/7/2025
4.0.13 12 6/7/2025
4.0.12 12 6/7/2025
4.0.11 11 6/7/2025
4.0.10 11 6/7/2025
4.0.9 36 6/7/2025
4.0.8 13 6/7/2025
4.0.7 20 6/7/2025
4.0.6 12 6/7/2025
4.0.5 12 6/7/2025
4.0.4 17 6/7/2025
4.0.3 13 6/7/2025
4.0.2 12 6/8/2025
4.0.1 12 6/8/2025
4.0.0 12 6/8/2025
4.0.0-rc1 11 6/7/2025
4.0.0-preview2 14 6/7/2025
4.0.0-preview1 10 6/8/2025
3.2.7 11 6/7/2025
3.2.6 12 6/7/2025
3.2.5 11 6/6/2025
3.2.4.1 11 6/7/2025
3.2.4 14 6/7/2025
3.2.3 11 6/7/2025
3.2.2 11 6/7/2025
3.2.1 11 6/8/2025
3.2.0 10 6/7/2025
3.1.10 13 6/7/2025
3.1.9 14 6/8/2025
3.1.8 10 6/7/2025
3.1.7 10 6/7/2025
3.1.6 11 6/7/2025
3.1.5 10 6/7/2025
3.1.4 12 6/7/2025
3.1.3 10 6/8/2025
3.1.2 10 6/8/2025
3.1.1 11 6/8/2025
3.1.0 11 6/7/2025
3.0.8 12 6/7/2025
3.0.7 11 6/7/2025
3.0.6 14 6/7/2025
3.0.5 11 6/7/2025
3.0.4 11 6/7/2025
3.0.3 11 6/8/2025
3.0.2 12 6/6/2025
3.0.1 11 6/8/2025
3.0.0 11 6/6/2025
2.2.7 12 6/8/2025
2.2.6 12 6/7/2025
2.2.5 11 6/7/2025
2.2.4.3 11 6/7/2025
2.2.4.1 11 6/8/2025
2.2.3 11 6/8/2025
2.2.2 11 6/7/2025
2.2.1 12 6/8/2025
2.2.0 11 6/7/2025
2.1.3 12 6/8/2025
2.1.2 13 6/7/2025
2.1.1 12 6/7/2025
2.1.0 11 6/8/2025
2.0.14.3 12 6/7/2025
2.0.12.1 11 6/7/2025
2.0.11 12 6/7/2025