Npgsql 10.0.1

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
DistributedLock
Provides easy-to-use mutexes, reader-writer locks, and semaphores that can synchronize across processes and machines. This is an umbrella package that brings in the entire family of DistributedLock.* packages (e. g. DistributedLock.SqlServer) as references. Those packages can also be installed individually.
13
DistributedLock
Provides easy-to-use mutexes, reader-writer locks, and semaphores that can synchronize across processes and machines. This is an umbrella package that brings in the entire family of DistributedLock.* packages (e. g. DistributedLock.SqlServer) as references. Those packages can also be installed individually.
11
DistributedLock.Postgres
Provides a distributed lock implementation based on Postgresql
11
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
11
DistributedLock.Postgres
Provides a distributed lock implementation based on Postgresql
10
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
10
DistributedLock
Provides easy-to-use mutexes, reader-writer locks, and semaphores that can synchronize across processes and machines. This is an umbrella package that brings in the entire family of DistributedLock.* packages (e. g. DistributedLock.SqlServer) as references. Those packages can also be installed individually.
9

Version Downloads Last updated
10.0.1 4 12/23/2025
10.0.0 11 11/22/2025
10.0.0-rc.1 10 10/21/2025
9.0.4 6 10/21/2025
9.0.3 8 10/5/2025
9.0.2 10 10/5/2025
9.0.1 11 10/5/2025
8.0.8 9 10/21/2025
8.0.7 8 10/5/2025
8.0.6 8 10/5/2025
8.0.5 14 10/5/2025
8.0.4 8 10/5/2025
8.0.3 8 10/5/2025
8.0.2 10 10/5/2025
8.0.1 8 10/5/2025
8.0.0 9 10/5/2025
8.0.0-rc.2 10 10/5/2025
8.0.0-preview.4 8 10/5/2025
8.0.0-preview.3 8 10/5/2025
8.0.0-preview.2 8 10/5/2025
8.0.0-preview.1 14 10/5/2025
7.0.10 9 10/5/2025
7.0.9 10 10/5/2025
7.0.8 9 10/5/2025
7.0.7 9 10/5/2025
7.0.6 7 10/5/2025
7.0.4 8 10/5/2025
7.0.2 7 10/5/2025
7.0.1 9 10/5/2025
7.0.0 10 10/5/2025
7.0.0-rc.2 13 10/5/2025
7.0.0-rc.1 13 10/5/2025
7.0.0-preview.7 10 10/5/2025
7.0.0-preview.6 8 10/5/2025
7.0.0-preview.5 10 10/5/2025
7.0.0-preview.4 11 10/5/2025
7.0.0-preview.3 9 10/5/2025
7.0.0-preview.2 9 10/5/2025
7.0.0-preview.1 11 10/5/2025
6.0.13 9 10/5/2025
6.0.12 10 10/5/2025
6.0.11 8 10/5/2025
6.0.10 9 10/5/2025
6.0.9 11 10/5/2025
6.0.8 9 10/5/2025
6.0.7 9 10/5/2025
6.0.6 9 10/5/2025
6.0.5 9 10/5/2025
6.0.4 9 10/5/2025
6.0.3 9 10/5/2025
6.0.2 9 10/5/2025
6.0.1 9 10/5/2025
6.0.0 11 10/5/2025
6.0.0-rc.2 8 10/5/2025
6.0.0-rc.1 12 10/5/2025
6.0.0-preview7 9 10/5/2025
6.0.0-preview6 8 10/5/2025
6.0.0-preview5 11 10/5/2025
6.0.0-preview4 11 10/5/2025
6.0.0-preview3 9 10/5/2025
6.0.0-preview2 8 10/5/2025
5.0.18 14 10/5/2025
5.0.17 10 10/5/2025
5.0.16 9 10/5/2025
5.0.15 8 10/5/2025
5.0.14 9 10/5/2025
5.0.13 9 10/5/2025
5.0.12 9 10/5/2025
5.0.11 9 10/5/2025
5.0.10 9 10/5/2025
5.0.7 13 10/5/2025
5.0.5 11 10/5/2025
5.0.4 9 10/5/2025
5.0.3 7 10/5/2025
5.0.2 13 10/5/2025
5.0.1.1 11 10/5/2025
5.0.0 14 10/5/2025
4.1.14 9 10/5/2025
4.1.13 10 10/5/2025
4.1.12 11 10/5/2025
4.1.11 10 10/5/2025
4.1.10 9 10/5/2025
4.1.9 7 10/5/2025
4.1.8 9 10/5/2025
4.1.7 9 10/5/2025
4.1.6 13 10/5/2025
4.1.5 12 10/5/2025
4.1.4 9 10/5/2025
4.1.3.1 8 10/5/2025
4.1.3 9 10/5/2025
4.1.2 10 10/5/2025
4.1.1 9 10/5/2025
4.1.0 8 10/5/2025
4.0.17 8 10/5/2025
4.0.16 9 10/5/2025
4.0.14 13 10/5/2025
4.0.13 9 10/5/2025
4.0.12 8 10/5/2025
4.0.11 10 10/5/2025
4.0.10 10 10/5/2025
4.0.9 10 10/5/2025
4.0.8 13 10/5/2025
4.0.7 9 10/5/2025
4.0.6 11 10/5/2025
4.0.5 12 10/5/2025
4.0.4 10 10/5/2025
4.0.3 12 10/5/2025
4.0.2 11 10/5/2025
4.0.1 11 10/5/2025
4.0.0 12 10/5/2025
4.0.0-rc1 10 10/5/2025
4.0.0-preview2 11 10/5/2025
4.0.0-preview1 9 10/5/2025
3.2.7 13 10/5/2025
3.2.6 10 10/5/2025
3.2.5 12 10/5/2025
3.2.4.1 9 10/5/2025
3.2.4 8 10/5/2025
3.2.3 8 10/5/2025
3.2.2 12 10/5/2025
3.2.1 10 10/5/2025
3.2.0 10 10/5/2025
3.1.10 9 10/5/2025
3.1.9 10 10/5/2025
3.1.8 10 10/5/2025
3.1.7 8 10/5/2025
3.1.6 10 10/5/2025
3.1.5 10 10/5/2025
3.1.4 9 10/5/2025
3.1.3 8 10/5/2025
3.1.2 7 10/5/2025
3.1.1 9 10/5/2025
3.1.0 13 10/5/2025
3.0.8 7 10/5/2025
3.0.7 8 10/5/2025
3.0.6 9 10/5/2025
3.0.5 9 10/5/2025
3.0.4 10 10/5/2025
3.0.3 10 10/5/2025
3.0.2 9 10/5/2025
3.0.1 7 10/5/2025
3.0.0 9 10/5/2025
2.2.7 9 10/5/2025
2.2.6 10 10/5/2025
2.2.5 9 10/5/2025
2.2.4.3 9 10/5/2025
2.2.4.1 11 10/5/2025
2.2.3 11 10/5/2025
2.2.2 8 10/5/2025
2.2.1 10 10/5/2025
2.2.0 9 10/5/2025
2.1.3 15 10/5/2025
2.1.2 10 10/5/2025
2.1.1 10 10/5/2025
2.1.0 14 10/5/2025
2.0.14.3 8 10/5/2025
2.0.12.1 9 10/5/2025
2.0.11 8 10/5/2025