Npgsql 6.0.9

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.
174
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
176
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
177
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
178
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
180
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
184
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
209
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
215
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
272
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
277
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
326
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
356
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
417
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
448
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
804
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
211
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
224
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
251
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
376
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
943

Version Downloads Last updated
10.0.3 29 05/27/2026
10.0.2 68 03/13/2026
10.0.1 87 12/19/2025
10.0.0 199 11/23/2025
10.0.0-rc.1 110 10/06/2025
9.0.5 41 03/14/2026
9.0.4 110 10/06/2025
9.0.3 319 03/27/2025
9.0.2 165 12/07/2024
9.0.1 161 11/19/2024
9.0.0 135 11/19/2024
8.0.9 49 03/14/2026
8.0.8 94 10/06/2025
8.0.7 121 04/02/2025
8.0.6 134 11/23/2024
8.0.5 174 10/21/2024
8.0.4 135 10/07/2024
8.0.3 190 06/27/2024
8.0.2 158 07/22/2024
8.0.1 183 02/04/2024
8.0.0 253 02/04/2024
8.0.0-rc.2 163 07/22/2024
8.0.0-preview.4 154 07/22/2024
8.0.0-preview.3 166 07/22/2024
8.0.0-preview.2 170 07/22/2024
8.0.0-preview.1 165 07/22/2024
7.0.10 141 04/02/2025
7.0.9 142 11/19/2024
7.0.8 134 10/08/2024
7.0.7 142 07/22/2024
7.0.6 138 07/22/2024
7.0.4 183 07/22/2024
7.0.2 226 02/04/2024
7.0.1 140 07/22/2024
7.0.0 167 02/04/2024
7.0.0-rc.2 153 07/22/2024
7.0.0-rc.1 129 07/22/2024
7.0.0-preview.7 151 07/22/2024
7.0.0-preview.6 162 07/22/2024
7.0.0-preview.5 165 07/22/2024
7.0.0-preview.4 154 07/22/2024
7.0.0-preview.3 163 07/22/2024
7.0.0-preview.2 148 07/22/2024
7.0.0-preview.1 172 07/22/2024
6.0.13 130 11/19/2024
6.0.12 148 10/08/2024
6.0.11 173 07/22/2024
6.0.10 150 07/22/2024
6.0.9 160 07/22/2024
6.0.8 165 07/22/2024
6.0.7 175 07/22/2024
6.0.6 152 07/22/2024
6.0.5 165 07/22/2024
6.0.4 204 02/09/2024
6.0.3 194 02/04/2024
6.0.2 193 07/22/2024
6.0.1 150 07/22/2024
6.0.0 172 07/22/2024
6.0.0-rc.2 159 07/22/2024
6.0.0-rc.1 142 07/22/2024
6.0.0-preview7 154 07/22/2024
6.0.0-preview6 159 07/22/2024
6.0.0-preview5 171 07/22/2024
6.0.0-preview4 157 07/22/2024
6.0.0-preview3 159 07/22/2024
6.0.0-preview2 159 07/22/2024
5.0.18 163 07/22/2024
5.0.17 162 07/22/2024
5.0.16 163 07/22/2024
5.0.15 158 07/22/2024
5.0.14 187 07/22/2024
5.0.13 172 07/20/2024
5.0.12 151 07/22/2024
5.0.11 154 07/22/2024
5.0.10 155 07/22/2024
5.0.7 173 07/21/2024
5.0.5 328 02/04/2024
5.0.4 165 07/22/2024
5.0.3 171 07/22/2024
5.0.2 191 07/22/2024
5.0.1.1 160 07/22/2024
5.0.0 150 07/22/2024
4.1.14 154 07/22/2024
4.1.13 166 07/22/2024
4.1.12 176 07/22/2024
4.1.11 170 07/22/2024
4.1.10 170 07/21/2024
4.1.9 170 07/22/2024
4.1.8 150 07/22/2024
4.1.7 167 07/22/2024
4.1.6 152 07/22/2024
4.1.5 155 07/22/2024
4.1.4 153 07/22/2024
4.1.3.1 180 07/22/2024
4.1.3 165 07/22/2024
4.1.2 188 07/22/2024
4.1.1 156 07/22/2024
4.1.0 178 07/22/2024
4.0.17 259 07/22/2024
4.0.16 178 07/22/2024
4.0.14 155 07/22/2024
4.0.13 157 07/22/2024
4.0.12 154 07/22/2024
4.0.11 168 07/22/2024
4.0.10 173 07/22/2024
4.0.9 178 07/22/2024
4.0.8 171 07/22/2024
4.0.7 161 07/22/2024
4.0.6 172 07/22/2024
4.0.5 149 07/22/2024
4.0.4 151 07/22/2024
4.0.3 165 07/22/2024
4.0.2 187 07/22/2024
4.0.1 161 07/22/2024
4.0.0 146 07/22/2024
4.0.0-rc1 183 07/22/2024
4.0.0-preview2 165 07/22/2024
4.0.0-preview1 161 07/22/2024
3.2.7 160 07/22/2024
3.2.6 154 07/22/2024
3.2.5 160 07/22/2024
3.2.4.1 160 07/22/2024
3.2.4 153 07/22/2024
3.2.3 136 07/22/2024
3.2.2 166 07/22/2024
3.2.1 172 07/22/2024
3.2.0 171 07/22/2024
3.1.10 141 07/22/2024
3.1.9 164 07/22/2024
3.1.8 153 07/22/2024
3.1.7 166 07/22/2024
3.1.6 155 07/22/2024
3.1.5 154 07/22/2024
3.1.4 148 07/22/2024
3.1.3 163 07/22/2024
3.1.2 156 07/22/2024
3.1.1 154 07/22/2024
3.1.0 167 07/22/2024
3.0.8 144 07/22/2024
3.0.7 172 07/22/2024
3.0.6 160 07/22/2024
3.0.5 164 07/22/2024
3.0.4 168 07/22/2024
3.0.3 162 07/22/2024
3.0.2 176 07/22/2024
3.0.1 172 07/22/2024
3.0.0 164 07/22/2024
2.2.7 163 07/22/2024
2.2.6 166 07/22/2024
2.2.5 190 07/22/2024
2.2.4.3 168 07/22/2024
2.2.4.1 183 07/22/2024
2.2.3 174 07/22/2024
2.2.2 186 07/22/2024
2.2.1 198 07/22/2024
2.2.0 168 07/22/2024
2.1.3 142 07/22/2024
2.1.2 160 07/22/2024
2.1.1 165 07/22/2024
2.1.0 173 07/22/2024
2.0.14.3 154 07/22/2024
2.0.12.1 150 07/22/2024
2.0.11 161 07/22/2024