Npgsql 9.0.5

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
PostgreSQL/Npgsql provider for Entity Framework Core.
142
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
144
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
149
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
154
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
178
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
186
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
239
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
244
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
272
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
386
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
414
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
704
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
140
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
142
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
181
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
226
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
346
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
143
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
789

Version Downloads Last updated
10.0.2 8 03/13/2026
10.0.1 49 12/19/2025
10.0.0 90 11/23/2025
10.0.0-rc.1 79 10/06/2025
9.0.5 5 03/14/2026
9.0.4 73 10/06/2025
9.0.3 288 03/27/2025
9.0.2 142 12/07/2024
9.0.1 126 11/19/2024
9.0.0 108 11/19/2024
8.0.9 5 03/14/2026
8.0.8 54 10/06/2025
8.0.7 84 04/02/2025
8.0.6 95 11/23/2024
8.0.5 142 10/21/2024
8.0.4 103 10/07/2024
8.0.3 153 06/27/2024
8.0.2 123 07/22/2024
8.0.1 142 02/04/2024
8.0.0 219 02/04/2024
8.0.0-rc.2 127 07/22/2024
8.0.0-preview.4 122 07/22/2024
8.0.0-preview.3 131 07/22/2024
8.0.0-preview.2 133 07/22/2024
8.0.0-preview.1 131 07/22/2024
7.0.10 101 04/02/2025
7.0.9 110 11/19/2024
7.0.8 103 10/08/2024
7.0.7 117 07/22/2024
7.0.6 113 07/22/2024
7.0.4 141 07/22/2024
7.0.2 193 02/04/2024
7.0.1 111 07/22/2024
7.0.0 144 02/04/2024
7.0.0-rc.2 127 07/22/2024
7.0.0-rc.1 104 07/22/2024
7.0.0-preview.7 124 07/22/2024
7.0.0-preview.6 133 07/22/2024
7.0.0-preview.5 140 07/22/2024
7.0.0-preview.4 131 07/22/2024
7.0.0-preview.3 132 07/22/2024
7.0.0-preview.2 125 07/22/2024
7.0.0-preview.1 131 07/22/2024
6.0.13 102 11/19/2024
6.0.12 119 10/08/2024
6.0.11 139 07/22/2024
6.0.10 116 07/22/2024
6.0.9 130 07/22/2024
6.0.8 128 07/22/2024
6.0.7 138 07/22/2024
6.0.6 118 07/22/2024
6.0.5 134 07/22/2024
6.0.4 171 02/09/2024
6.0.3 160 02/04/2024
6.0.2 146 07/22/2024
6.0.1 120 07/22/2024
6.0.0 143 07/22/2024
6.0.0-rc.2 128 07/22/2024
6.0.0-rc.1 115 07/22/2024
6.0.0-preview7 124 07/22/2024
6.0.0-preview6 130 07/22/2024
6.0.0-preview5 143 07/22/2024
6.0.0-preview4 131 07/22/2024
6.0.0-preview3 131 07/22/2024
6.0.0-preview2 126 07/22/2024
5.0.18 134 07/22/2024
5.0.17 140 07/22/2024
5.0.16 136 07/22/2024
5.0.15 123 07/22/2024
5.0.14 162 07/22/2024
5.0.13 142 07/20/2024
5.0.12 119 07/22/2024
5.0.11 124 07/22/2024
5.0.10 120 07/22/2024
5.0.7 144 07/21/2024
5.0.5 281 02/04/2024
5.0.4 132 07/22/2024
5.0.3 142 07/22/2024
5.0.2 156 07/22/2024
5.0.1.1 120 07/22/2024
5.0.0 122 07/22/2024
4.1.14 119 07/22/2024
4.1.13 131 07/22/2024
4.1.12 136 07/22/2024
4.1.11 134 07/22/2024
4.1.10 135 07/21/2024
4.1.9 129 07/22/2024
4.1.8 117 07/22/2024
4.1.7 137 07/22/2024
4.1.6 128 07/22/2024
4.1.5 117 07/22/2024
4.1.4 128 07/22/2024
4.1.3.1 147 07/22/2024
4.1.3 122 07/22/2024
4.1.2 144 07/22/2024
4.1.1 121 07/22/2024
4.1.0 128 07/22/2024
4.0.17 210 07/22/2024
4.0.16 142 07/22/2024
4.0.14 126 07/22/2024
4.0.13 118 07/22/2024
4.0.12 125 07/22/2024
4.0.11 127 07/22/2024
4.0.10 138 07/22/2024
4.0.9 136 07/22/2024
4.0.8 139 07/22/2024
4.0.7 127 07/22/2024
4.0.6 136 07/22/2024
4.0.5 115 07/22/2024
4.0.4 126 07/22/2024
4.0.3 133 07/22/2024
4.0.2 150 07/22/2024
4.0.1 132 07/22/2024
4.0.0 115 07/22/2024
4.0.0-rc1 143 07/22/2024
4.0.0-preview2 131 07/22/2024
4.0.0-preview1 131 07/22/2024
3.2.7 120 07/22/2024
3.2.6 125 07/22/2024
3.2.5 131 07/22/2024
3.2.4.1 130 07/22/2024
3.2.4 123 07/22/2024
3.2.3 121 07/22/2024
3.2.2 123 07/22/2024
3.2.1 134 07/22/2024
3.2.0 142 07/22/2024
3.1.10 114 07/22/2024
3.1.9 137 07/22/2024
3.1.8 120 07/22/2024
3.1.7 133 07/22/2024
3.1.6 120 07/22/2024
3.1.5 124 07/22/2024
3.1.4 125 07/22/2024
3.1.3 127 07/22/2024
3.1.2 129 07/22/2024
3.1.1 127 07/22/2024
3.1.0 131 07/22/2024
3.0.8 114 07/22/2024
3.0.7 139 07/22/2024
3.0.6 133 07/22/2024
3.0.5 134 07/22/2024
3.0.4 135 07/22/2024
3.0.3 127 07/22/2024
3.0.2 150 07/22/2024
3.0.1 140 07/22/2024
3.0.0 137 07/22/2024
2.2.7 135 07/22/2024
2.2.6 128 07/22/2024
2.2.5 158 07/22/2024
2.2.4.3 131 07/22/2024
2.2.4.1 149 07/22/2024
2.2.3 132 07/22/2024
2.2.2 148 07/22/2024
2.2.1 145 07/22/2024
2.2.0 133 07/22/2024
2.1.3 125 07/22/2024
2.1.2 130 07/22/2024
2.1.1 136 07/22/2024
2.1.0 136 07/22/2024
2.0.14.3 124 07/22/2024
2.0.12.1 119 07/22/2024
2.0.11 126 07/22/2024