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.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | npgsql/efcore.pg |
| Owner | npgsql |
| Primary language | C# |
| License | PostgreSQL — Requires review (not clearly OSI) |
| Stars | 1.8k |
| Forks | 260 |
| Open issues | 290 |
| Latest release | v10.0.2 (2026-05-27) |
| Last updated | 2026-07-07 |
| Source | https://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.
Get the efcore.pg source
Clone the repository and explore it locally.
git clone https://github.com/npgsql/efcore.pg.gitcd efcore.pg# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
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.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Strong |
| License clarity | Clear |
| Deployment complexity | Low |
| DEV.co fit | Strong |
| Assessment confidence | High |
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.
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.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
efcore.pg FAQ
Can I use this provider with .NET Framework (not .NET Core)?
Does this provider support Entity Framework Core migrations?
What if I need to use stored procedures or complex PostgreSQL logic?
Is this project production-ready?
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.