Npgsql 10.0.0-rc.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.EntityFrameworkCore.PostgreSQL
Npgsql.EntityFrameworkCore.PostgreSQL
3,970
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
98
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
889
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
1,643
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
6,304
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
10,914
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
15,105
Npgsql.EntityFrameworkCore.PostgreSQL.Design
Npgsql.EntityFrameworkCore.PostgreSQL.Design
3,968
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
83
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
84
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
88
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
94
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
99
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
104
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
110
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
113
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
119
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
127

.NET 8.0

.NET 9.0

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