Npgsql 9.0.3

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,967
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
94
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
884
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
1,639
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
6,300
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
10,911
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
15,100
Npgsql.EntityFrameworkCore.PostgreSQL.Design
Npgsql.EntityFrameworkCore.PostgreSQL.Design
3,960
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
77
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
78
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
82
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.
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.
99
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
103
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
105
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
112
Npgsql.NetTopologySuite
NetTopologySuite plugin for Npgsql, allowing mapping of PostGIS geometry types to NetTopologySuite types.
118

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