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.
Related packages
- The Entity Framework Core provider that works with this provider is Npgsql.EntityFrameworkCore.PostgreSQL.
- Spatial plugin to work with PostgreSQL PostGIS: Npgsql.NetTopologySuite
- NodaTime plugin to use better date/time types with PostgreSQL: Npgsql.NodaTime
- OpenTelemetry support can be set up with Npgsql.OpenTelemetry
Showing the top 20 packages that depend on Npgsql.
| Packages | Downloads |
|---|---|
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
189 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
190 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
191 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
196 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
225 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
226 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
285 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
288 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
344 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
391 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
430 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
459 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
819 |
|
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
186 |
|
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
222 |
|
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
241 |
|
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
261 |
|
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
388 |
|
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
|
968 |
.NET Core 3.1
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
.NET Standard 2.1
- System.Threading.Channels (>= 6.0.0)
- System.Text.Json (>= 6.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
- System.Collections.Immutable (>= 6.0.0)
.NET Standard 2.0
- System.Threading.Channels (>= 6.0.0)
- System.Text.Json (>= 6.0.0)
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
- System.Collections.Immutable (>= 6.0.0)
- Microsoft.Bcl.HashCode (>= 1.1.1)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
.NET 6.0
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
.NET 5.0
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
| Version | Downloads | Last updated |
|---|---|---|
| 10.0.3 | 68 | 05/27/2026 |
| 10.0.2 | 87 | 03/13/2026 |
| 10.0.1 | 103 | 12/19/2025 |
| 10.0.0 | 221 | 11/23/2025 |
| 10.0.0-rc.1 | 124 | 10/06/2025 |
| 9.0.5 | 58 | 03/14/2026 |
| 9.0.4 | 120 | 10/06/2025 |
| 9.0.3 | 336 | 03/27/2025 |
| 9.0.2 | 173 | 12/07/2024 |
| 9.0.1 | 174 | 11/19/2024 |
| 9.0.0 | 154 | 11/19/2024 |
| 8.0.9 | 70 | 03/14/2026 |
| 8.0.8 | 117 | 10/06/2025 |
| 8.0.7 | 138 | 04/02/2025 |
| 8.0.6 | 154 | 11/23/2024 |
| 8.0.5 | 200 | 10/21/2024 |
| 8.0.4 | 154 | 10/07/2024 |
| 8.0.3 | 202 | 06/27/2024 |
| 8.0.2 | 174 | 07/22/2024 |
| 8.0.1 | 198 | 02/04/2024 |
| 8.0.0 | 275 | 02/04/2024 |
| 8.0.0-rc.2 | 175 | 07/22/2024 |
| 8.0.0-preview.4 | 165 | 07/22/2024 |
| 8.0.0-preview.3 | 186 | 07/22/2024 |
| 8.0.0-preview.2 | 187 | 07/22/2024 |
| 8.0.0-preview.1 | 177 | 07/22/2024 |
| 7.0.10 | 180 | 04/02/2025 |
| 7.0.9 | 153 | 11/19/2024 |
| 7.0.8 | 149 | 10/08/2024 |
| 7.0.7 | 158 | 07/22/2024 |
| 7.0.6 | 153 | 07/22/2024 |
| 7.0.4 | 199 | 07/22/2024 |
| 7.0.2 | 240 | 02/04/2024 |
| 7.0.1 | 151 | 07/22/2024 |
| 7.0.0 | 181 | 02/04/2024 |
| 7.0.0-rc.2 | 166 | 07/22/2024 |
| 7.0.0-rc.1 | 144 | 07/22/2024 |
| 7.0.0-preview.7 | 163 | 07/22/2024 |
| 7.0.0-preview.6 | 178 | 07/22/2024 |
| 7.0.0-preview.5 | 181 | 07/22/2024 |
| 7.0.0-preview.4 | 182 | 07/22/2024 |
| 7.0.0-preview.3 | 174 | 07/22/2024 |
| 7.0.0-preview.2 | 164 | 07/22/2024 |
| 7.0.0-preview.1 | 187 | 07/22/2024 |
| 6.0.13 | 142 | 11/19/2024 |
| 6.0.12 | 163 | 10/08/2024 |
| 6.0.11 | 188 | 07/22/2024 |
| 6.0.10 | 167 | 07/22/2024 |
| 6.0.9 | 181 | 07/22/2024 |
| 6.0.8 | 184 | 07/22/2024 |
| 6.0.7 | 190 | 07/22/2024 |
| 6.0.6 | 163 | 07/22/2024 |
| 6.0.5 | 185 | 07/22/2024 |
| 6.0.4 | 225 | 02/09/2024 |
| 6.0.3 | 209 | 02/04/2024 |
| 6.0.2 | 204 | 07/22/2024 |
| 6.0.1 | 166 | 07/22/2024 |
| 6.0.0 | 184 | 07/22/2024 |
| 6.0.0-rc.2 | 186 | 07/22/2024 |
| 6.0.0-rc.1 | 156 | 07/22/2024 |
| 6.0.0-preview7 | 166 | 07/22/2024 |
| 6.0.0-preview6 | 172 | 07/22/2024 |
| 6.0.0-preview5 | 185 | 07/22/2024 |
| 6.0.0-preview4 | 174 | 07/22/2024 |
| 6.0.0-preview3 | 173 | 07/22/2024 |
| 6.0.0-preview2 | 172 | 07/22/2024 |
| 5.0.18 | 179 | 07/22/2024 |
| 5.0.17 | 176 | 07/22/2024 |
| 5.0.16 | 176 | 07/22/2024 |
| 5.0.15 | 169 | 07/22/2024 |
| 5.0.14 | 202 | 07/22/2024 |
| 5.0.13 | 183 | 07/20/2024 |
| 5.0.12 | 163 | 07/22/2024 |
| 5.0.11 | 165 | 07/22/2024 |
| 5.0.10 | 166 | 07/22/2024 |
| 5.0.7 | 187 | 07/21/2024 |
| 5.0.5 | 342 | 02/04/2024 |
| 5.0.4 | 177 | 07/22/2024 |
| 5.0.3 | 185 | 07/22/2024 |
| 5.0.2 | 204 | 07/22/2024 |
| 5.0.1.1 | 174 | 07/22/2024 |
| 5.0.0 | 165 | 07/22/2024 |
| 4.1.14 | 173 | 07/22/2024 |
| 4.1.13 | 179 | 07/22/2024 |
| 4.1.12 | 191 | 07/22/2024 |
| 4.1.11 | 190 | 07/22/2024 |
| 4.1.10 | 182 | 07/21/2024 |
| 4.1.9 | 188 | 07/22/2024 |
| 4.1.8 | 165 | 07/22/2024 |
| 4.1.7 | 178 | 07/22/2024 |
| 4.1.6 | 165 | 07/22/2024 |
| 4.1.5 | 169 | 07/22/2024 |
| 4.1.4 | 166 | 07/22/2024 |
| 4.1.3.1 | 191 | 07/22/2024 |
| 4.1.3 | 182 | 07/22/2024 |
| 4.1.2 | 201 | 07/22/2024 |
| 4.1.1 | 177 | 07/22/2024 |
| 4.1.0 | 205 | 07/22/2024 |
| 4.0.17 | 294 | 07/22/2024 |
| 4.0.16 | 190 | 07/22/2024 |
| 4.0.14 | 169 | 07/22/2024 |
| 4.0.13 | 173 | 07/22/2024 |
| 4.0.12 | 166 | 07/22/2024 |
| 4.0.11 | 183 | 07/22/2024 |
| 4.0.10 | 187 | 07/22/2024 |
| 4.0.9 | 191 | 07/22/2024 |
| 4.0.8 | 188 | 07/22/2024 |
| 4.0.7 | 174 | 07/22/2024 |
| 4.0.6 | 189 | 07/22/2024 |
| 4.0.5 | 162 | 07/22/2024 |
| 4.0.4 | 163 | 07/22/2024 |
| 4.0.3 | 180 | 07/22/2024 |
| 4.0.2 | 204 | 07/22/2024 |
| 4.0.1 | 179 | 07/22/2024 |
| 4.0.0 | 162 | 07/22/2024 |
| 4.0.0-rc1 | 198 | 07/22/2024 |
| 4.0.0-preview2 | 178 | 07/22/2024 |
| 4.0.0-preview1 | 174 | 07/22/2024 |
| 3.2.7 | 181 | 07/22/2024 |
| 3.2.6 | 168 | 07/22/2024 |
| 3.2.5 | 174 | 07/22/2024 |
| 3.2.4.1 | 177 | 07/22/2024 |
| 3.2.4 | 167 | 07/22/2024 |
| 3.2.3 | 147 | 07/22/2024 |
| 3.2.2 | 177 | 07/22/2024 |
| 3.2.1 | 185 | 07/22/2024 |
| 3.2.0 | 183 | 07/22/2024 |
| 3.1.10 | 154 | 07/22/2024 |
| 3.1.9 | 172 | 07/22/2024 |
| 3.1.8 | 165 | 07/22/2024 |
| 3.1.7 | 179 | 07/22/2024 |
| 3.1.6 | 171 | 07/22/2024 |
| 3.1.5 | 170 | 07/22/2024 |
| 3.1.4 | 159 | 07/22/2024 |
| 3.1.3 | 176 | 07/22/2024 |
| 3.1.2 | 166 | 07/22/2024 |
| 3.1.1 | 169 | 07/22/2024 |
| 3.1.0 | 177 | 07/22/2024 |
| 3.0.8 | 158 | 07/22/2024 |
| 3.0.7 | 187 | 07/22/2024 |
| 3.0.6 | 175 | 07/22/2024 |
| 3.0.5 | 179 | 07/22/2024 |
| 3.0.4 | 182 | 07/22/2024 |
| 3.0.3 | 176 | 07/22/2024 |
| 3.0.2 | 189 | 07/22/2024 |
| 3.0.1 | 186 | 07/22/2024 |
| 3.0.0 | 178 | 07/22/2024 |
| 2.2.7 | 176 | 07/22/2024 |
| 2.2.6 | 181 | 07/22/2024 |
| 2.2.5 | 201 | 07/22/2024 |
| 2.2.4.3 | 180 | 07/22/2024 |
| 2.2.4.1 | 196 | 07/22/2024 |
| 2.2.3 | 187 | 07/22/2024 |
| 2.2.2 | 201 | 07/22/2024 |
| 2.2.1 | 211 | 07/22/2024 |
| 2.2.0 | 182 | 07/22/2024 |
| 2.1.3 | 158 | 07/22/2024 |
| 2.1.2 | 177 | 07/22/2024 |
| 2.1.1 | 176 | 07/22/2024 |
| 2.1.0 | 185 | 07/22/2024 |
| 2.0.14.3 | 171 | 07/22/2024 |
| 2.0.12.1 | 170 | 07/22/2024 |
| 2.0.11 | 171 | 07/22/2024 |