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 Async overload — callable against an AuroraDbConnection, a BaseRepository<TEntity, AuroraDbConnection>, or a DbRepository<AuroraDbConnection>, with an entity list, a DataTable, or an IDataReader (BulkDeleteByKey takes a list of primary key values instead).
  • AuroraDbBulkImportIdentityBehavior (KeepIdentity default, ReturnIdentity) — controls whether identity values are sent as-is or read back via a RETURNING clause.
  • AuroraDbBulkImportPseudoTableType (Auto, Memory, Physical) — selects the staging-table strategy: Auto (the default) picks Physical at 5,000 rows or more, Memory below that. Unlike CockroachDB, Memory needs no special session flag — Aurora PostgreSQL supports temporary tables natively.
  • AuroraDbBulkInsertMapItem — explicit source-to-destination column mapping for BulkInsert/BulkMerge/BulkUpdate, with an optional AuroraDbType override per mapping, and up-front type-compatibility checking.
  • AuroraDbTraceKeys — the traceKey constants for use with a custom ITrace.
  • A BulkMerge with identityBehavior: ReturnIdentity pre-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 single INSERT ... OVERRIDING SYSTEM VALUE ... ON CONFLICT DO UPDATE ... RETURNING statement, 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 via ALTER 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 binary COPY emits the exact width the server expects for each column.
  • Targets .NET 8, .NET 9 and .NET 10.

Known limitations (v1)

  • RepoDb.Connector.AuroraDb.Npgsql is a prerelease package (v0.0.1-alpha1); its public API (AuroraDbConnection, AuroraDbBulkCopy, etc.) may still change before it reaches a stable release.
  • BulkInsert/BulkMerge with identityBehavior: ReturnIdentity read identity values back with a single INSERT ... SELECT ... ORDER BY <row-order column> ... RETURNING <identity> statement, assuming RETURNING emits rows in the same order as the ordered SELECT — 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.
  • AuroraDbBulkCopy runs the binary COPY on the Npgsql connection it unwraps from the AWS Advanced .NET Data Provider Wrapper, so a server error raised during the COPY itself (a plain BulkInsert violating a primary key or NOT NULL constraint, for example) surfaces as Npgsql.PostgresException, not AuroraDbException — catch System.Data.Common.DbException and read SqlState to 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 Physical staging (or Auto at 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. Use Memory staging for concurrent callers.
  • No Unspecified identity-behavior state — AuroraDbBulkImportIdentityBehavior defaults straight to KeepIdentity.

Bumps

  • Referenced the RepoDb package v1.17.0-alpha3.
  • Referenced the RepoDb.AuroraDb.PostgreSql package v0.0.1-alpha1.
  • References the RepoDb.Connector.AuroraDb.Npgsql package v0.0.1-alpha1.