AuroraDB PostgreSQL (Bulk)
This page contains the latest information of the releases of RepoDb.AuroraDb.PostgreSql.BulkOperations library.
View the NuGet package here or download it directly here.
RepoDb.AuroraDb.PostgreSql.BulkOperations (v0.0.1-alpha1) - Preview
Released: September 27, 2026
New
First (alpha) release of the bulk operations extension for RepoDb.AuroraDb.PostgreSql, built on AuroraDbBulkCopy, a native binary COPY-based bulk writer from RepoDb.Connector.AuroraDb.Npgsql.
What’s included
- BulkInsert, BulkMerge, BulkUpdate, BulkDelete, and BulkDeleteByKey, each with an
Asyncoverload — callable against anAuroraDbConnection, aBaseRepository<TEntity, AuroraDbConnection>, or aDbRepository<AuroraDbConnection>, with an entity list, aDataTable, or anIDataReader(BulkDeleteByKeytakes a list of primary key values instead). - AuroraDbBulkImportIdentityBehavior (
KeepIdentitydefault,ReturnIdentity) — controls whether identity values are sent as-is or read back via aRETURNINGclause. - AuroraDbBulkImportPseudoTableType (
Auto,Memory,Physical) — selects the staging-table strategy:Auto(the default) picksPhysicalat 5,000 rows or more,Memorybelow that. Unlike CockroachDB,Memoryneeds no special session flag — Aurora PostgreSQL supports temporary tables natively. - AuroraDbBulkInsertMapItem — explicit source-to-destination column mapping for
BulkInsert/BulkMerge/BulkUpdate, with an optionalAuroraDbTypeoverride per mapping, and up-front type-compatibility checking. - AuroraDbTraceKeys — the
traceKeyconstants for use with a custom ITrace. - A
BulkMergewithidentityBehavior: ReturnIdentitypre-assigns identities for the rows that will be inserted (nextval(pg_get_serial_sequence(...))) and then performs the whole upsert — matched and unmatched rows alike — through a singleINSERT ... OVERRIDING SYSTEM VALUE ... ON CONFLICT DO UPDATE ... RETURNINGstatement, rather than the multi-statement snapshot/update/insert sequence some other providers require for the same feature. - The pseudo (staging) table is created with
CREATE [TEMP] TABLE ... AS SELECT ... WHERE (1 = 0)— the same staging SQL as RepoDb.EnterpriseDb.BulkOperations, which runs unchanged on PostgreSQL — then given its own__RepoDbBulkRowOrder__identity column viaALTER TABLE. - An internal type-coercing data reader converts every mapped value to its destination column’s actual CLR type before it reaches
AuroraDbBulkCopy, so Npgsql’s binaryCOPYemits the exact width the server expects for each column. - Targets .NET 8, .NET 9 and .NET 10.
Known limitations (v1)
RepoDb.Connector.AuroraDb.Npgsqlis a prerelease package (v0.0.1-alpha1); its public API (AuroraDbConnection,AuroraDbBulkCopy, etc.) may still change before it reaches a stable release.BulkInsert/BulkMergewithidentityBehavior: ReturnIdentityread identity values back with a singleINSERT ... SELECT ... ORDER BY <row-order column> ... RETURNING <identity>statement, assumingRETURNINGemits rows in the same order as the orderedSELECT— PostgreSQL documents no such guarantee. This has been checked (and holds) for 1,000 rows on a single PostgreSQL server, but not against a real Aurora cluster.AuroraDbBulkCopyruns the binaryCOPYon the Npgsql connection it unwraps from the AWS Advanced .NET Data Provider Wrapper, so a server error raised during theCOPYitself (a plainBulkInsertviolating a primary key orNOT NULLconstraint, for example) surfaces asNpgsql.PostgresException, notAuroraDbException— catchSystem.Data.Common.DbExceptionand readSqlStateto handle both.- Passing an already-completed transaction (committed or rolled back) to a bulk operation is not detected or rejected — the rows are written outside of any transaction and auto-committed, so they cannot be rolled back. Only pass a transaction that is still active.
- Two concurrent callers using
Physicalstaging (orAutoat 5,000 rows or more) against the same target table share one staging table, since it is named deterministically from{pseudoTableType}{tableName}{Operation}— this can corrupt each other’s staged rows. UseMemorystaging for concurrent callers. - No
Unspecifiedidentity-behavior state — AuroraDbBulkImportIdentityBehavior defaults straight toKeepIdentity.
Bumps
- Referenced the
RepoDbpackagev1.17.0-alpha3. - Referenced the
RepoDb.AuroraDb.PostgreSqlpackagev0.0.1-alpha1. - References the
RepoDb.Connector.AuroraDb.Npgsqlpackagev0.0.1-alpha1.