-
-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
When using the function BulkInsertOrUpdate with UpdateByProperties with postgres an error occurs:
CREATE INDEX CONCURRENTLY cannot run inside a transaction block
---> Npgsql.PostgresException (0x80004005): 25001: CREATE INDEX CONCURRENTLY cannot run inside a transaction block
The issue seems to be in PostgreSqlQueryBuilder.CountUniqueConstrain, there is a check only for constraints, but an index can also be marked as unique, producing identical uniqueness behavior.
So I have no explicit unique constraint on the property but a unique index.
A possible workaround is to define the property defined in UpdateByProperties as ef core alternate key (HasAlternateKey) instead of unique index (HasIndex(x => ...).IsUnique()).
This will create a constraint behind the scenes additionally to the unique index.
Metadata
Metadata
Assignees
Labels
No labels