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.
|
169 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
171 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
172 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
173 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
175 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
179 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
204 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
211 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
268 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
272 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
314 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
338 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
412 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
442 |
|
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
794 |
|
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
203 |
|
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
212 |
|
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
246 |
|
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
|
371 |
|
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
|
929 |
.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 | 22 | 05/27/2026 |
| 10.0.2 | 63 | 03/13/2026 |
| 10.0.1 | 84 | 12/19/2025 |
| 10.0.0 | 193 | 11/23/2025 |
| 10.0.0-rc.1 | 104 | 10/06/2025 |
| 9.0.5 | 37 | 03/14/2026 |
| 9.0.4 | 105 | 10/06/2025 |
| 9.0.3 | 316 | 03/27/2025 |
| 9.0.2 | 162 | 12/07/2024 |
| 9.0.1 | 156 | 11/19/2024 |
| 9.0.0 | 129 | 11/19/2024 |
| 8.0.9 | 43 | 03/14/2026 |
| 8.0.8 | 88 | 10/06/2025 |
| 8.0.7 | 116 | 04/02/2025 |
| 8.0.6 | 126 | 11/23/2024 |
| 8.0.5 | 171 | 10/21/2024 |
| 8.0.4 | 132 | 10/07/2024 |
| 8.0.3 | 187 | 06/27/2024 |
| 8.0.2 | 153 | 07/22/2024 |
| 8.0.1 | 178 | 02/04/2024 |
| 8.0.0 | 247 | 02/04/2024 |
| 8.0.0-rc.2 | 159 | 07/22/2024 |
| 8.0.0-preview.4 | 148 | 07/22/2024 |
| 8.0.0-preview.3 | 162 | 07/22/2024 |
| 8.0.0-preview.2 | 165 | 07/22/2024 |
| 8.0.0-preview.1 | 159 | 07/22/2024 |
| 7.0.10 | 133 | 04/02/2025 |
| 7.0.9 | 139 | 11/19/2024 |
| 7.0.8 | 127 | 10/08/2024 |
| 7.0.7 | 137 | 07/22/2024 |
| 7.0.6 | 132 | 07/22/2024 |
| 7.0.4 | 177 | 07/22/2024 |
| 7.0.2 | 221 | 02/04/2024 |
| 7.0.1 | 135 | 07/22/2024 |
| 7.0.0 | 163 | 02/04/2024 |
| 7.0.0-rc.2 | 149 | 07/22/2024 |
| 7.0.0-rc.1 | 125 | 07/22/2024 |
| 7.0.0-preview.7 | 145 | 07/22/2024 |
| 7.0.0-preview.6 | 155 | 07/22/2024 |
| 7.0.0-preview.5 | 160 | 07/22/2024 |
| 7.0.0-preview.4 | 149 | 07/22/2024 |
| 7.0.0-preview.3 | 158 | 07/22/2024 |
| 7.0.0-preview.2 | 145 | 07/22/2024 |
| 7.0.0-preview.1 | 164 | 07/22/2024 |
| 6.0.13 | 125 | 11/19/2024 |
| 6.0.12 | 145 | 10/08/2024 |
| 6.0.11 | 164 | 07/22/2024 |
| 6.0.10 | 145 | 07/22/2024 |
| 6.0.9 | 157 | 07/22/2024 |
| 6.0.8 | 160 | 07/22/2024 |
| 6.0.7 | 172 | 07/22/2024 |
| 6.0.6 | 146 | 07/22/2024 |
| 6.0.5 | 162 | 07/22/2024 |
| 6.0.4 | 199 | 02/09/2024 |
| 6.0.3 | 188 | 02/04/2024 |
| 6.0.2 | 188 | 07/22/2024 |
| 6.0.1 | 146 | 07/22/2024 |
| 6.0.0 | 166 | 07/22/2024 |
| 6.0.0-rc.2 | 155 | 07/22/2024 |
| 6.0.0-rc.1 | 139 | 07/22/2024 |
| 6.0.0-preview7 | 148 | 07/22/2024 |
| 6.0.0-preview6 | 155 | 07/22/2024 |
| 6.0.0-preview5 | 166 | 07/22/2024 |
| 6.0.0-preview4 | 153 | 07/22/2024 |
| 6.0.0-preview3 | 153 | 07/22/2024 |
| 6.0.0-preview2 | 154 | 07/22/2024 |
| 5.0.18 | 160 | 07/22/2024 |
| 5.0.17 | 160 | 07/22/2024 |
| 5.0.16 | 159 | 07/22/2024 |
| 5.0.15 | 154 | 07/22/2024 |
| 5.0.14 | 183 | 07/22/2024 |
| 5.0.13 | 167 | 07/20/2024 |
| 5.0.12 | 146 | 07/22/2024 |
| 5.0.11 | 151 | 07/22/2024 |
| 5.0.10 | 148 | 07/22/2024 |
| 5.0.7 | 167 | 07/21/2024 |
| 5.0.5 | 325 | 02/04/2024 |
| 5.0.4 | 159 | 07/22/2024 |
| 5.0.3 | 166 | 07/22/2024 |
| 5.0.2 | 187 | 07/22/2024 |
| 5.0.1.1 | 156 | 07/22/2024 |
| 5.0.0 | 146 | 07/22/2024 |
| 4.1.14 | 148 | 07/22/2024 |
| 4.1.13 | 161 | 07/22/2024 |
| 4.1.12 | 169 | 07/22/2024 |
| 4.1.11 | 165 | 07/22/2024 |
| 4.1.10 | 164 | 07/21/2024 |
| 4.1.9 | 162 | 07/22/2024 |
| 4.1.8 | 144 | 07/22/2024 |
| 4.1.7 | 163 | 07/22/2024 |
| 4.1.6 | 148 | 07/22/2024 |
| 4.1.5 | 151 | 07/22/2024 |
| 4.1.4 | 149 | 07/22/2024 |
| 4.1.3.1 | 176 | 07/22/2024 |
| 4.1.3 | 156 | 07/22/2024 |
| 4.1.2 | 185 | 07/22/2024 |
| 4.1.1 | 150 | 07/22/2024 |
| 4.1.0 | 173 | 07/22/2024 |
| 4.0.17 | 252 | 07/22/2024 |
| 4.0.16 | 171 | 07/22/2024 |
| 4.0.14 | 151 | 07/22/2024 |
| 4.0.13 | 152 | 07/22/2024 |
| 4.0.12 | 150 | 07/22/2024 |
| 4.0.11 | 157 | 07/22/2024 |
| 4.0.10 | 168 | 07/22/2024 |
| 4.0.9 | 173 | 07/22/2024 |
| 4.0.8 | 168 | 07/22/2024 |
| 4.0.7 | 155 | 07/22/2024 |
| 4.0.6 | 168 | 07/22/2024 |
| 4.0.5 | 144 | 07/22/2024 |
| 4.0.4 | 147 | 07/22/2024 |
| 4.0.3 | 160 | 07/22/2024 |
| 4.0.2 | 182 | 07/22/2024 |
| 4.0.1 | 156 | 07/22/2024 |
| 4.0.0 | 141 | 07/22/2024 |
| 4.0.0-rc1 | 178 | 07/22/2024 |
| 4.0.0-preview2 | 160 | 07/22/2024 |
| 4.0.0-preview1 | 155 | 07/22/2024 |
| 3.2.7 | 155 | 07/22/2024 |
| 3.2.6 | 151 | 07/22/2024 |
| 3.2.5 | 157 | 07/22/2024 |
| 3.2.4.1 | 156 | 07/22/2024 |
| 3.2.4 | 149 | 07/22/2024 |
| 3.2.3 | 133 | 07/22/2024 |
| 3.2.2 | 161 | 07/22/2024 |
| 3.2.1 | 169 | 07/22/2024 |
| 3.2.0 | 166 | 07/22/2024 |
| 3.1.10 | 137 | 07/22/2024 |
| 3.1.9 | 161 | 07/22/2024 |
| 3.1.8 | 147 | 07/22/2024 |
| 3.1.7 | 161 | 07/22/2024 |
| 3.1.6 | 151 | 07/22/2024 |
| 3.1.5 | 151 | 07/22/2024 |
| 3.1.4 | 143 | 07/22/2024 |
| 3.1.3 | 158 | 07/22/2024 |
| 3.1.2 | 155 | 07/22/2024 |
| 3.1.1 | 149 | 07/22/2024 |
| 3.1.0 | 162 | 07/22/2024 |
| 3.0.8 | 139 | 07/22/2024 |
| 3.0.7 | 167 | 07/22/2024 |
| 3.0.6 | 156 | 07/22/2024 |
| 3.0.5 | 159 | 07/22/2024 |
| 3.0.4 | 163 | 07/22/2024 |
| 3.0.3 | 159 | 07/22/2024 |
| 3.0.2 | 173 | 07/22/2024 |
| 3.0.1 | 166 | 07/22/2024 |
| 3.0.0 | 161 | 07/22/2024 |
| 2.2.7 | 160 | 07/22/2024 |
| 2.2.6 | 162 | 07/22/2024 |
| 2.2.5 | 185 | 07/22/2024 |
| 2.2.4.3 | 164 | 07/22/2024 |
| 2.2.4.1 | 179 | 07/22/2024 |
| 2.2.3 | 169 | 07/22/2024 |
| 2.2.2 | 184 | 07/22/2024 |
| 2.2.1 | 191 | 07/22/2024 |
| 2.2.0 | 163 | 07/22/2024 |
| 2.1.3 | 141 | 07/22/2024 |
| 2.1.2 | 154 | 07/22/2024 |
| 2.1.1 | 161 | 07/22/2024 |
| 2.1.0 | 165 | 07/22/2024 |
| 2.0.14.3 | 147 | 07/22/2024 |
| 2.0.12.1 | 145 | 07/22/2024 |
| 2.0.11 | 155 | 07/22/2024 |