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.
133
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
136
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
174
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
182
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
231
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
233
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
254
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
379
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
399
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
668
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
135
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.
178
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
221
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
342
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
135
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
763

Version Downloads Last updated
10.0.1 33 12/19/2025
10.0.0 73 11/23/2025
10.0.0-rc.1 60 10/06/2025
9.0.4 62 10/06/2025
9.0.3 280 03/27/2025
9.0.2 138 12/07/2024
9.0.1 110 11/19/2024
9.0.0 90 11/19/2024
8.0.8 50 10/06/2025
8.0.7 81 04/02/2025
8.0.6 86 11/23/2024
8.0.5 124 10/21/2024
8.0.4 99 10/07/2024
8.0.3 147 06/27/2024
8.0.2 107 07/22/2024
8.0.1 137 02/04/2024
8.0.0 200 02/04/2024
8.0.0-rc.2 117 07/22/2024
8.0.0-preview.4 112 07/22/2024
8.0.0-preview.3 112 07/22/2024
8.0.0-preview.2 124 07/22/2024
8.0.0-preview.1 116 07/22/2024
7.0.10 97 04/02/2025
7.0.9 96 11/19/2024
7.0.8 98 10/08/2024
7.0.7 108 07/22/2024
7.0.6 107 07/22/2024
7.0.4 134 07/22/2024
7.0.2 179 02/04/2024
7.0.1 107 07/22/2024
7.0.0 140 02/04/2024
7.0.0-rc.2 111 07/22/2024
7.0.0-rc.1 99 07/22/2024
7.0.0-preview.7 119 07/22/2024
7.0.0-preview.6 127 07/22/2024
7.0.0-preview.5 128 07/22/2024
7.0.0-preview.4 128 07/22/2024
7.0.0-preview.3 117 07/22/2024
7.0.0-preview.2 107 07/22/2024
7.0.0-preview.1 121 07/22/2024
6.0.13 96 11/19/2024
6.0.12 116 10/08/2024
6.0.11 132 07/22/2024
6.0.10 110 07/22/2024
6.0.9 118 07/22/2024
6.0.8 111 07/22/2024
6.0.7 119 07/22/2024
6.0.6 113 07/22/2024
6.0.5 131 07/22/2024
6.0.4 157 02/09/2024
6.0.3 154 02/04/2024
6.0.2 129 07/22/2024
6.0.1 114 07/22/2024
6.0.0 127 07/22/2024
6.0.0-rc.2 119 07/22/2024
6.0.0-rc.1 105 07/22/2024
6.0.0-preview7 121 07/22/2024
6.0.0-preview6 126 07/22/2024
6.0.0-preview5 134 07/22/2024
6.0.0-preview4 126 07/22/2024
6.0.0-preview3 126 07/22/2024
6.0.0-preview2 121 07/22/2024
5.0.18 127 07/22/2024
5.0.17 136 07/22/2024
5.0.16 126 07/22/2024
5.0.15 118 07/22/2024
5.0.14 145 07/22/2024
5.0.13 131 07/20/2024
5.0.12 115 07/22/2024
5.0.11 121 07/22/2024
5.0.10 114 07/22/2024
5.0.7 129 07/21/2024
5.0.5 271 02/04/2024
5.0.4 123 07/22/2024
5.0.3 127 07/22/2024
5.0.2 143 07/22/2024
5.0.1.1 113 07/22/2024
5.0.0 116 07/22/2024
4.1.14 106 07/22/2024
4.1.13 125 07/22/2024
4.1.12 129 07/22/2024
4.1.11 130 07/22/2024
4.1.10 122 07/21/2024
4.1.9 115 07/22/2024
4.1.8 113 07/22/2024
4.1.7 122 07/22/2024
4.1.6 124 07/22/2024
4.1.5 111 07/22/2024
4.1.4 116 07/22/2024
4.1.3.1 130 07/22/2024
4.1.3 110 07/22/2024
4.1.2 122 07/22/2024
4.1.1 106 07/22/2024
4.1.0 119 07/22/2024
4.0.17 194 07/22/2024
4.0.16 136 07/22/2024
4.0.14 121 07/22/2024
4.0.13 110 07/22/2024
4.0.12 106 07/22/2024
4.0.11 123 07/22/2024
4.0.10 126 07/22/2024
4.0.9 129 07/22/2024
4.0.8 127 07/22/2024
4.0.7 124 07/22/2024
4.0.6 130 07/22/2024
4.0.5 107 07/22/2024
4.0.4 122 07/22/2024
4.0.3 129 07/22/2024
4.0.2 130 07/22/2024
4.0.1 120 07/22/2024
4.0.0 113 07/22/2024
4.0.0-rc1 130 07/22/2024
4.0.0-preview2 112 07/22/2024
4.0.0-preview1 119 07/22/2024
3.2.7 105 07/22/2024
3.2.6 120 07/22/2024
3.2.5 121 07/22/2024
3.2.4.1 113 07/22/2024
3.2.4 113 07/22/2024
3.2.3 116 07/22/2024
3.2.2 117 07/22/2024
3.2.1 121 07/22/2024
3.2.0 125 07/22/2024
3.1.10 111 07/22/2024
3.1.9 124 07/22/2024
3.1.8 106 07/22/2024
3.1.7 122 07/22/2024
3.1.6 111 07/22/2024
3.1.5 120 07/22/2024
3.1.4 119 07/22/2024
3.1.3 117 07/22/2024
3.1.2 108 07/22/2024
3.1.1 124 07/22/2024
3.1.0 112 07/22/2024
3.0.8 106 07/22/2024
3.0.7 125 07/22/2024
3.0.6 126 07/22/2024
3.0.5 130 07/22/2024
3.0.4 119 07/22/2024
3.0.3 114 07/22/2024
3.0.2 142 07/22/2024
3.0.1 130 07/22/2024
3.0.0 126 07/22/2024
2.2.7 133 07/22/2024
2.2.6 120 07/22/2024
2.2.5 145 07/22/2024
2.2.4.3 116 07/22/2024
2.2.4.1 142 07/22/2024
2.2.3 114 07/22/2024
2.2.2 127 07/22/2024
2.2.1 133 07/22/2024
2.2.0 123 07/22/2024
2.1.3 120 07/22/2024
2.1.2 126 07/22/2024
2.1.1 124 07/22/2024
2.1.0 132 07/22/2024
2.0.14.3 109 07/22/2024
2.0.12.1 117 07/22/2024
2.0.11 114 07/22/2024