Domain creation fails when in UpgradeMode=Perform on PostgreSQL 9.2. I'm running DataObjects.NET 4.6.4 along with the matching PostgreSQL provider. It only fails during creation, not during update. I’ve traced the error through to a query looking for the missing metadata table faulting the transaction and causing subsequent queries to fail, specifically:
SELECT "a"."Name" AS "Name", "a"."Version" AS "Version" FROM "Workflow"."Metadata.Assembly" "a"
logs the following:
ERROR relation "Workflow.Metadata.Assembly" does not exist at character 62
This is expected, I guess, as the schema is empty. However, it follows up with
SET CONSTRAINTS ALL IMMEDIATE;
which fails with:
ERROR current transaction is aborted, commands ignored until end of transaction block
Running the same code with the UpgradeMode=Recreate works fine, so our workaround for now is to use this to lay down the schema.
The part of the stack trace you’d be interested in is as follows:
I'm assuming that this is not expected behaviour, and that running Perform should work properly on an empty database. I'd appreciate it if you could either confirm this as a fault or point out what I'm doing wrong.
Thanks for your help.
asked Nov 10 '13 at 19:11
DataObjects.Net somehow supports what you want (Perform from empty database). But there are issues with actual implementation. In Perform mode DO tries to fetch existing metadata from the DB. If this fails, DO just ignores any error. You could see a warning in the log if it is configured. It seems that such errors are critical for PostgreSQL. If error occurs connection is no longer usable. I think we need to improve handling of this situation. Maybe reset connection or something like that. I'll post an update when there is more information on this issue.
answered Nov 11 '13 at 07:13