Npgsql 10.0.0

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.EntityFrameworkCore.PostgreSQL
Npgsql.EntityFrameworkCore.PostgreSQL
3,972
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
101
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
893
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
1,647
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
6,307
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
10,919
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
15,109
Npgsql.EntityFrameworkCore.PostgreSQL.Design
Npgsql.EntityFrameworkCore.PostgreSQL.Design
3,970
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
85
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
89
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
95
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
97
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
98
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
100
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
106
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
111
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
114
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
122
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
128

Version Downloads Last updated
10.0.0 2 11/24/2025
10.0.0-rc.1 8 10/06/2025
9.0.4 6 10/07/2025
9.0.3 17 02/27/2025
9.0.2 34 12/13/2024
9.0.1 31 11/26/2024
9.0.0 33 12/14/2024
8.0.8 9 10/08/2025
8.0.7 22 02/27/2025
8.0.6 19 11/26/2024
8.0.5 22 10/14/2024
8.0.4 24 09/11/2024
8.0.3 35 05/22/2024
8.0.2 39 02/16/2024
8.0.1 43 12/05/2023
8.0.0 33 11/21/2023
8.0.0-rc.2 42 10/13/2023
8.0.0-preview.4 41 05/31/2023
8.0.0-preview.3 58 05/09/2023
8.0.0-preview.2 51 04/04/2023
8.0.0-preview.1 43 04/04/2023
7.0.10 30 03/19/2025
7.0.9 21 11/26/2024
7.0.8 18 09/12/2024
7.0.7 26 05/22/2024
7.0.6 25 09/25/2023
7.0.4 41 06/07/2023
7.0.2 44 04/04/2023
7.0.1 36 01/15/2023
7.0.0 1,599 11/15/2022
7.0.0-rc.2 119 12/01/2022
7.0.0-rc.1 87 09/22/2022
7.0.0-preview.7 45 09/04/2022
7.0.0-preview.6 105 07/30/2022
7.0.0-preview.5 95 09/08/2022
7.0.0-preview.4 56 09/07/2022
7.0.0-preview.3 40 09/08/2022
7.0.0-preview.2 85 09/02/2022
7.0.0-preview.1 36 09/07/2022
6.0.13 23 11/26/2024
6.0.12 28 09/11/2024
6.0.11 27 05/22/2024
6.0.10 39 09/27/2023
6.0.9 43 04/04/2023
6.0.8 6,306 01/15/2023
6.0.7 14,455 09/21/2022
6.0.6 85 09/03/2022
6.0.5 48 08/21/2022
6.0.4 78 08/25/2022
6.0.3 187 06/28/2022
6.0.2 56 09/02/2022
6.0.1 84 08/21/2022
6.0.0 62 09/03/2022
6.0.0-rc.2 107 08/25/2022
6.0.0-rc.1 55 08/23/2022
6.0.0-preview7 50 09/05/2022
6.0.0-preview6 77 08/24/2022
6.0.0-preview5 53 08/04/2022
6.0.0-preview4 65 08/24/2022
6.0.0-preview3 37 08/22/2022
6.0.0-preview2 77 08/25/2022
5.0.18 33 05/22/2024
5.0.17 28 09/23/2023
5.0.16 54 04/04/2023
5.0.15 54 09/22/2022
5.0.14 95 08/24/2022
5.0.13 34 09/08/2022
5.0.12 66 09/02/2022
5.0.11 38 09/02/2022
5.0.10 10,831 06/27/2022
5.0.7 35 09/09/2022
5.0.5 73 09/07/2022
5.0.4 76 08/23/2022
5.0.3 65 09/03/2022
5.0.2 37 09/09/2022
5.0.1.1 77 09/08/2022
5.0.0 93 08/02/2022
4.1.14 29 05/22/2024
4.1.13 37 05/15/2024
4.1.12 44 08/23/2022
4.1.11 47 09/09/2022
4.1.10 58 08/27/2022
4.1.9 50 09/10/2022
4.1.8 97 08/22/2022
4.1.7 47 09/02/2022
4.1.6 39 09/07/2022
4.1.5 74 09/08/2022
4.1.4 61 09/03/2022
4.1.3.1 30 09/07/2022
4.1.3 108 09/09/2022
4.1.2 63 09/09/2022
4.1.1 103 09/03/2022
4.1.0 74 08/26/2022
4.0.17 21 06/10/2024
4.0.16 27 05/22/2024
4.0.14 27 05/22/2024
4.0.13 58 08/23/2022
4.0.12 63 09/09/2022
4.0.11 52 09/02/2022
4.0.10 89 09/09/2022
4.0.9 50 09/02/2022
4.0.8 38 08/21/2022
4.0.7 65 09/03/2022
4.0.6 42 09/02/2022
4.0.5 50 08/22/2022
4.0.4 42 09/02/2022
4.0.3 90 09/07/2022
4.0.2 95 09/09/2022
4.0.1 103 09/02/2022
4.0.0 104 08/20/2022
4.0.0-rc1 34 09/07/2022
4.0.0-preview2 51 08/24/2022
4.0.0-preview1 49 09/02/2022
3.2.7 44 06/29/2022
3.2.6 51 07/02/2022
3.2.5 72 09/07/2022
3.2.4.1 31 07/31/2022
3.2.4 49 08/22/2022
3.2.3 64 07/05/2022
3.2.2 34 08/24/2022
3.2.1 55 09/08/2022
3.2.0 113 09/02/2022
3.1.10 86 09/07/2022
3.1.9 3,964 06/27/2022
3.1.8 47 09/08/2022
3.1.7 54 08/15/2022
3.1.6 39 09/04/2022
3.1.5 46 09/06/2022
3.1.4 28 09/08/2022
3.1.3 64 07/31/2022
3.1.2 95 09/08/2022
3.1.1 100 08/23/2022
3.1.0 98 08/23/2022
3.0.8 49 09/08/2022
3.0.7 85 08/24/2022
3.0.6 103 07/31/2022
3.0.5 36 09/03/2022
3.0.4 45 07/11/2022
3.0.3 56 08/21/2022
3.0.2 80 09/07/2022
3.0.1 49 08/26/2022
3.0.0 41 08/22/2022
2.2.7 91 09/02/2022
2.2.6 35 07/01/2022
2.2.5 37 08/27/2022
2.2.4.3 46 08/24/2022
2.2.4.1 45 09/09/2022
2.2.3 55 09/08/2022
2.2.2 61 09/09/2022
2.2.1 34 08/21/2022
2.2.0 55 08/22/2022
2.1.3 45 09/08/2022
2.1.2 80 07/13/2022
2.1.1 62 08/24/2022
2.1.0 131 09/10/2022
2.0.14.3 71 09/02/2022
2.0.12.1 46 08/24/2022
2.0.11 73 08/26/2022