Closed naigsa closed 6 years ago
This is a PostgreSQL error informing you that a column already exists, I can't really think of anything at the Npgsql ADO.NET layer that could trigger this (between 3.2.7 and 4.0.0)... All Npgsql does is send the SQL to PostgreSQL and read back the results.
Can you double-check this isn't an unrelated issue on your end somehow? If not, a wireshark comparison of the traffic between Npgsql and PostgreSQL would help investigate this - if there really is some significant change between 3.2.7 and 4.0.0 it'll show up.
ok, i will investigate it and will write about issue. But, i sure that is influence of npgsql 4, because I did the actions below: upgrade npgsql 4 - i got above error, downgrade package back - all works fine
i am created minimal project for show this issue https://nofile.io/f/YbafgxkZb5T/NpgsqlTest1.zip Solution has two porjects. One with npgsql3 and one with npgsql4. Both projects has identical logic. For start project create empty db and add uuid support:
SQl Command: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"
Then invoke post method:
POST /entity HTTP/1.1 Host: localhost:62524 Content-Type: application/json Cache-Control: no-cache Postman-Token: 33e0ff06-c275-4205-8a44-8f6747622f8a
{ "alias": "test", "name": "test" }
Can you please post the PostgreSQL statement logs for both runs, i.e. once with Npgsql 3.2 (successful) and once with the newly-released Npgsql 4.0 (failure)?
I checked the problem with version 4.0.0 and automigrations works fine.
Great, thanks for confirming.
Before submitting
After upgarde npgsql from 3.2.7 to 4.0.0-preview2 automigrations in entity framework are not working.
Steps to reproduce
Create two ef contexts with one migration table and with settings:
The issue
i get error "column "ContextKey" of relation "__MigrationHistory" already exists"
Further technical details
Net Framework: 4.6.1 EntityFramework: 6.2.0 Npgsql version: 4.0.0-preview2 PostgreSQL version: 9.6.1 Operating system: windows 7