Update Fails when using autoincrement (Serial) fields
Posted: Thu 10 Mar 2011 15:59
Hello, we have converted from MySQL to postgre.
Previous Auto-Increment fields are handled by Serial Fields using Sequences within postgre. The serial field is the primary index.
This causes a few problems with pgDAC.
1 -The insert query needs to be changed so that it does not include the Serial Field or this fails with null violation error.
2 - After an insert operation, further edits on the inserted record fail with "Update Fail, Found 0 records" I assume that this fails because pgDAC does not know the new value of the serial field.
Once the dataset is refreshed, edits work fine.
Is there a more elegant way around this than refreshing the entire dataset?
Thanks
AndyC++
Previous Auto-Increment fields are handled by Serial Fields using Sequences within postgre. The serial field is the primary index.
This causes a few problems with pgDAC.
1 -The insert query needs to be changed so that it does not include the Serial Field or this fails with null violation error.
2 - After an insert operation, further edits on the inserted record fail with "Update Fail, Found 0 records" I assume that this fails because pgDAC does not know the new value of the serial field.
Once the dataset is refreshed, edits work fine.
Is there a more elegant way around this than refreshing the entire dataset?
Thanks
AndyC++