Npgsql 9.0.3

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
Microsoft.SemanticKernel.Connectors.Postgres
Postgres(with pgvector extension) connector for Semantic Kernel plugins and semantic memory
6
Pgvector
pgvector support for C#
6
Pgvector
pgvector support for Npgsql
6
Pgvector
pgvector support for .NET (C#, F#, and Visual Basic)
5
Pgvector
pgvector support for C#
5
Microsoft.SemanticKernel.Connectors.Postgres
Postgres(with pgvector extension) connector for Semantic Kernel plugins and semantic memory
4
Pgvector
pgvector support for C#
4

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