DEV.co
Open-Source Databases · npgsql

efcore.pg

Npgsql.EntityFrameworkCore.PostgreSQL is the official Entity Framework Core provider for PostgreSQL, enabling .NET developers to use familiar LINQ syntax and ORM patterns to interact with PostgreSQL databases. It builds on the Npgsql ADO.NET driver and supports PostgreSQL-specific features like JSON, arrays, and ranges.

Source: GitHub — github.com/npgsql/efcore.pg
1.8k
GitHub stars
260
Forks
C#
Primary language
PostgreSQL
License (Requires review (not clearly OSI))

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorynpgsql/efcore.pg
Ownernpgsql
Primary languageC#
LicensePostgreSQL — Requires review (not clearly OSI)
Stars1.8k
Forks260
Open issues290
Latest releasev10.0.2 (2026-05-27)
Last updated2026-07-07
Sourcehttps://github.com/npgsql/efcore.pg

What efcore.pg is

A C# EF Core provider that translates LINQ queries to PostgreSQL SQL, built atop Npgsql. Exposes PostgreSQL-native types and query capabilities (JSON, arrays, ranges) while maintaining standard EF Core semantics. Includes optional plugins for spatial (PostGIS) and temporal (NodaTime) data types.

Quickstart

Get the efcore.pg source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/npgsql/efcore.pg.gitcd efcore.pg# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

.NET applications requiring PostgreSQL as primary database

Teams using C# and Entity Framework Core who need a production-grade, feature-complete ORM provider for PostgreSQL without switching persistence frameworks or writing raw SQL.

Applications leveraging PostgreSQL-specific data types

Projects that depend on JSON columns, array types, or range types in PostgreSQL and need first-class EF Core support for querying and mapping these advanced types natively.

Cross-platform .NET (Core/5+) services on Linux/Docker

Modern cloud-native or containerized .NET services where PostgreSQL is the standard database and you require open-source, non-proprietary ORM integration.

Implementation considerations

  • Verify Entity Framework Core version compatibility; this provider tracks EF Core release cycles and breaking changes must be managed during upgrades.
  • Configure connection pooling and async/await patterns correctly to avoid connection exhaustion and deadlocks in high-concurrency scenarios.
  • Test PostgreSQL-specific type mappings (JSON, arrays, ranges) early; default CLR mappings may not always match your schema expectations.
  • Plan migration strategy if migrating from another ORM; DbContext design and fluent configuration patterns differ from other frameworks.
  • Evaluate optional plugins (PostGIS, NodaTime) before committing; they add dependencies and require schema/model alignment.

When to avoid it — and what to weigh

  • You require a different database engine as primary store — This provider only works with PostgreSQL. If multi-database flexibility or vendor lock-in avoidance is a priority, consider Dapper, raw ADO.NET, or database-agnostic frameworks.
  • Your team is not using Entity Framework Core or .NET — If your stack is Java, Python, Node.js, or Go, this provider is irrelevant; use language-native PostgreSQL clients (psycopg, node-postgres, sqlc, etc.).
  • You have extensive existing raw SQL or stored procedures you cannot refactor — While EF Core supports raw SQL, heavy reliance on unmanaged stored procedures or complex procedural logic may make the ORM overhead unjustified; consider Dapper or direct Npgsql ADO.NET.
  • You need guaranteed backward compatibility across major EF Core versions — EF Core and its providers follow a regular release cycle with breaking changes. Assess upgrade burden and test coverage requirements for long-lived systems.

License & commercial use

Licensed under the PostgreSQL License (also known as the Postgres License), which is an OSI-approved permissive license similar to the BSD license. It permits modification, distribution, and private use with minimal restrictions.

The PostgreSQL License explicitly permits commercial use, modification, and distribution. No attribution requirement or viral clause exists. Review the full license text at https://opensource.org/licenses/PostgreSQL for your specific use case, but commercial deployment is unambiguously allowed.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

Standard ORM security practices apply: parameterized queries (via LINQ/EF Core) mitigate SQL injection; review connection string handling to avoid credential leakage (use secrets management, environment variables, or secure vaults). Encryption in transit and at rest depend on PostgreSQL server and application configuration, not the provider itself. No known CVEs or security audit results provided; assess dependency chain (Npgsql) for updates. Application-level authorization and input validation remain the developer's responsibility.

Alternatives to consider

Dapper

Lightweight micro-ORM for .NET; lower abstraction, minimal overhead, excellent for teams prioritizing performance over convenience. Requires manual SQL or generated queries.

Npgsql (ADO.NET only)

Raw ADO.NET driver for PostgreSQL; maximum control and performance, no ORM abstraction. Suitable if avoiding ORM overhead or integrating into legacy non-EF systems.

EF Core with other providers (SqlServer, SQLite)

If database flexibility is required or if your team is already embedded in a different RDBMS ecosystem, standard EF Core with another provider avoids PostgreSQL-specific binding.

Software development agency

Build on efcore.pg with DEV.co software developers

Npgsql.EntityFrameworkCore.PostgreSQL is a mature, actively maintained OSI-licensed ORM for .NET teams using PostgreSQL. Evaluate it against raw ADO.NET or Dapper for your use case. Let Devco guide architecture, security, and deployment strategy.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

efcore.pg FAQ

Can I use this provider with .NET Framework (not .NET Core)?
Unknown. The data provided does not specify .NET Framework compatibility. EF Core itself requires .NET 6.0 or later; review the official docs or test your target runtime.
Does this provider support Entity Framework Core migrations?
Yes. The documentation link and standard EF Core integration suggest full migration support via the dotnet ef tool. Test migration strategies early in your project.
What if I need to use stored procedures or complex PostgreSQL logic?
EF Core and Npgsql.EntityFrameworkCore.PostgreSQL support calling stored procedures via FromSqlInterpolated and raw SQL execution, but heavy procedural logic may favor raw Npgsql or Dapper.
Is this project production-ready?
Yes. It has 10 years of history, 1831 stars, active maintenance, and regular releases. However, assess your own testing, upgrade cycles, and risk tolerance before deploying to critical systems.

Software development & web development with DEV.co

DEV.co helps companies turn open-source tools like efcore.pg into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source databases stack.

Ready to Deploy PostgreSQL with .NET?

Npgsql.EntityFrameworkCore.PostgreSQL is a mature, actively maintained OSI-licensed ORM for .NET teams using PostgreSQL. Evaluate it against raw ADO.NET or Dapper for your use case. Let Devco guide architecture, security, and deployment strategy.