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.
60
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
61
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
81
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
89
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
98
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
100
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
109
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
121
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
137
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
284
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
298
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
60
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
61
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
73
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
82
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
109
Npgsql.Json.NET
Json.NET plugin for Npgsql, allowing transparent serialization/deserialization of JSON objects directly to and from the database.
148
Serilog.Sinks.PostgreSQL
Serilog sink for writing to PostgreSQL table
466

Version Downloads Last updated
9.0.3 68 03/27/2025
9.0.2 29 12/07/2024
9.0.1 29 11/19/2024
9.0.0 25 11/19/2024
8.0.7 22 04/02/2025
8.0.6 21 11/23/2024
8.0.5 34 10/21/2024
8.0.4 25 10/07/2024
8.0.3 80 06/27/2024
8.0.2 42 07/22/2024
8.0.1 58 02/04/2024
8.0.0 127 02/04/2024
8.0.0-rc.2 40 07/22/2024
8.0.0-preview.4 47 07/22/2024
8.0.0-preview.3 46 07/22/2024
8.0.0-preview.2 43 07/22/2024
8.0.0-preview.1 42 07/22/2024
7.0.10 23 04/02/2025
7.0.9 30 11/19/2024
7.0.8 23 10/08/2024
7.0.7 47 07/22/2024
7.0.6 49 07/22/2024
7.0.4 62 07/22/2024
7.0.2 107 02/04/2024
7.0.1 48 07/22/2024
7.0.0 64 02/04/2024
7.0.0-rc.2 49 07/22/2024
7.0.0-rc.1 37 07/22/2024
7.0.0-preview.7 48 07/22/2024
7.0.0-preview.6 52 07/22/2024
7.0.0-preview.5 49 07/22/2024
7.0.0-preview.4 48 07/22/2024
7.0.0-preview.3 46 07/22/2024
7.0.0-preview.2 46 07/22/2024
7.0.0-preview.1 45 07/22/2024
6.0.13 21 11/19/2024
6.0.12 32 10/08/2024
6.0.11 48 07/22/2024
6.0.10 45 07/22/2024
6.0.9 48 07/22/2024
6.0.8 44 07/22/2024
6.0.7 56 07/22/2024
6.0.6 49 07/22/2024
6.0.5 51 07/22/2024
6.0.4 80 02/09/2024
6.0.3 85 02/04/2024
6.0.2 52 07/22/2024
6.0.1 46 07/22/2024
6.0.0 53 07/22/2024
6.0.0-rc.2 51 07/22/2024
6.0.0-rc.1 41 07/22/2024
6.0.0-preview7 61 07/22/2024
6.0.0-preview6 44 07/22/2024
6.0.0-preview5 47 07/22/2024
6.0.0-preview4 46 07/22/2024
6.0.0-preview3 43 07/22/2024
6.0.0-preview2 50 07/22/2024
5.0.18 54 07/22/2024
5.0.17 58 07/22/2024
5.0.16 54 07/22/2024
5.0.15 52 07/22/2024
5.0.14 54 07/22/2024
5.0.13 56 07/20/2024
5.0.12 51 07/22/2024
5.0.11 45 07/22/2024
5.0.10 42 07/22/2024
5.0.7 51 07/21/2024
5.0.5 166 02/04/2024
5.0.4 51 07/22/2024
5.0.3 50 07/22/2024
5.0.2 51 07/22/2024
5.0.1.1 46 07/22/2024
5.0.0 44 07/22/2024
4.1.14 44 07/22/2024
4.1.13 60 07/22/2024
4.1.12 46 07/22/2024
4.1.11 57 07/22/2024
4.1.10 56 07/21/2024
4.1.9 43 07/22/2024
4.1.8 40 07/22/2024
4.1.7 48 07/22/2024
4.1.6 55 07/22/2024
4.1.5 46 07/22/2024
4.1.4 49 07/22/2024
4.1.3.1 60 07/22/2024
4.1.3 42 07/22/2024
4.1.2 53 07/22/2024
4.1.1 48 07/22/2024
4.1.0 49 07/22/2024
4.0.17 84 07/22/2024
4.0.16 70 07/22/2024
4.0.14 51 07/22/2024
4.0.13 49 07/22/2024
4.0.12 45 07/22/2024
4.0.11 49 07/22/2024
4.0.10 58 07/22/2024
4.0.9 54 07/22/2024
4.0.8 54 07/22/2024
4.0.7 51 07/22/2024
4.0.6 52 07/22/2024
4.0.5 44 07/22/2024
4.0.4 47 07/22/2024
4.0.3 51 07/22/2024
4.0.2 59 07/22/2024
4.0.1 42 07/22/2024
4.0.0 46 07/22/2024
4.0.0-rc1 53 07/22/2024
4.0.0-preview2 46 07/22/2024
4.0.0-preview1 51 07/22/2024
3.2.7 47 07/22/2024
3.2.6 56 07/22/2024
3.2.5 56 07/22/2024
3.2.4.1 45 07/22/2024
3.2.4 56 07/22/2024
3.2.3 55 07/22/2024
3.2.2 49 07/22/2024
3.2.1 53 07/22/2024
3.2.0 48 07/22/2024
3.1.10 45 07/22/2024
3.1.9 53 07/22/2024
3.1.8 42 07/22/2024
3.1.7 47 07/22/2024
3.1.6 47 07/22/2024
3.1.5 53 07/22/2024
3.1.4 45 07/22/2024
3.1.3 53 07/22/2024
3.1.2 44 07/22/2024
3.1.1 51 07/22/2024
3.1.0 37 07/22/2024
3.0.8 45 07/22/2024
3.0.7 50 07/22/2024
3.0.6 53 07/22/2024
3.0.5 57 07/22/2024
3.0.4 57 07/22/2024
3.0.3 53 07/22/2024
3.0.2 53 07/22/2024
3.0.1 46 07/22/2024
3.0.0 51 07/22/2024
2.2.7 56 07/22/2024
2.2.6 55 07/22/2024
2.2.5 58 07/22/2024
2.2.4.3 48 07/22/2024
2.2.4.1 49 07/22/2024
2.2.3 55 07/22/2024
2.2.2 40 07/22/2024
2.2.1 57 07/22/2024
2.2.0 54 07/22/2024
2.1.3 49 07/22/2024
2.1.2 62 07/22/2024
2.1.1 51 07/22/2024
2.1.0 56 07/22/2024
2.0.14.3 52 07/22/2024
2.0.12.1 54 07/22/2024
2.0.11 42 07/22/2024