EF.Toolkit.Audit.PostgreSQL 10.0.0-alpha.5

This is a prerelease version of EF.Toolkit.Audit.PostgreSQL.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package EF.Toolkit.Audit.PostgreSQL --version 10.0.0-alpha.5
                    
NuGet\Install-Package EF.Toolkit.Audit.PostgreSQL -Version 10.0.0-alpha.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EF.Toolkit.Audit.PostgreSQL" Version="10.0.0-alpha.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EF.Toolkit.Audit.PostgreSQL" Version="10.0.0-alpha.5" />
                    
Directory.Packages.props
<PackageReference Include="EF.Toolkit.Audit.PostgreSQL" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EF.Toolkit.Audit.PostgreSQL --version 10.0.0-alpha.5
                    
#r "nuget: EF.Toolkit.Audit.PostgreSQL, 10.0.0-alpha.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EF.Toolkit.Audit.PostgreSQL@10.0.0-alpha.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EF.Toolkit.Audit.PostgreSQL&version=10.0.0-alpha.5&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=EF.Toolkit.Audit.PostgreSQL&version=10.0.0-alpha.5&prerelease
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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