EF.Toolkit.Audit.PostgreSQL
10.0.0-alpha.7
dotnet add package EF.Toolkit.Audit.PostgreSQL --version 10.0.0-alpha.7
NuGet\Install-Package EF.Toolkit.Audit.PostgreSQL -Version 10.0.0-alpha.7
<PackageReference Include="EF.Toolkit.Audit.PostgreSQL" Version="10.0.0-alpha.7" />
<PackageVersion Include="EF.Toolkit.Audit.PostgreSQL" Version="10.0.0-alpha.7" />
<PackageReference Include="EF.Toolkit.Audit.PostgreSQL" />
paket add EF.Toolkit.Audit.PostgreSQL --version 10.0.0-alpha.7
#r "nuget: EF.Toolkit.Audit.PostgreSQL, 10.0.0-alpha.7"
#:package EF.Toolkit.Audit.PostgreSQL@10.0.0-alpha.7
#addin nuget:?package=EF.Toolkit.Audit.PostgreSQL&version=10.0.0-alpha.7&prerelease
#tool nuget:?package=EF.Toolkit.Audit.PostgreSQL&version=10.0.0-alpha.7&prerelease
EF.Toolkit.Audit.PostgreSQL
The PostgreSQL provider for EF.Toolkit.Audit. Install this package rather than the core one: it brings the core with it and maps the audit table onto PostgreSQL types.
Install
dotnet add package EF.Toolkit.Audit.PostgreSQL
Setup
One call, after the provider:
services.AddDbContext<AppDb>(o => o
.UseNpgsql(connectionString)
.UseAuditing(a => a.Schema("audit")));
If you reference both provider packages, use UseNpgsqlAuditing().
What this package provides
The audit table's shape is decided here. The columns that differ from SQL Server:
| Column | Type |
|---|---|
EntityType, EntityKey, ActorId, ActorName, ActorType, TenantId, Source |
text |
OccurredAt |
timestamptz |
CorrelationId |
uuid |
Changes |
jsonb, behind a GIN index |
The payload is searchable, not just readable
jsonb under a GIN index is the reason to prefer PostgreSQL for an audit trail: the payload answers
containment queries directly, so a trail can be searched by what actually changed rather than only
read back per row.
-- uses the GIN index
SELECT * FROM audit."AuditEntries"
WHERE "Changes" @> '{"new":{"Status":"Shipped"}}';
-- also indexed
SELECT * FROM audit."AuditEntries"
WHERE "Changes" -> 'changed' ? 'Status';
old and new are sibling objects rather than a per-property pair of the two, precisely because
that is the shape a containment index can answer.
Beyond the payload index, entries are indexed by default on
(EntityType, EntityKey, OccurredAt DESC) — the history of one row — plus actor, correlation and
tenant when multi-tenancy is configured.
Supported versions
PostgreSQL 16 and 17, both covered by the differential harness on every commit.
Full documentation
Everything else — registering entity types and properties, actors, ambient scopes, multi-tenancy, the payload format, options, diagnostics and limitations — is in the EF.Toolkit.Audit documentation.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- EF.Toolkit.Audit (>= 10.0.0-alpha.7)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.0 && < 11.0.0)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 10.0.0 && < 11.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.0-alpha.7 | 73 | 10/18/2026 |
| 10.0.0-alpha.6 | 237 | 8/18/2026 |
| 10.0.0-alpha.5 | 96 | 8/15/2026 |
| 10.0.0-alpha.4 | 90 | 8/14/2026 |
| 10.0.0-alpha.3 | 86 | 8/14/2026 |