Hi all,
I've migrated an Access database schema to PostgreSQL, and I'm trying to get
everything working again. I'm having the following problem...
Within an Access transaction, I insert a row into one table, then I insert a
row into a table with a foreign key relationship to the first record. The
second insert fails with a referential integrity violation referring to the
same relationhip I mentioned. This worked fine with a JET back-end and the
same relationships.
It's as if my 2 inserts are not using the same connection or something, so my
second insert doesn't "see" the first one since it's not committed yet. All
statements are executed via the same DAO workspace. I'm using DAO because I'm
dealing with heterogenious data, doing things like inserting into PostgreSQL
tables based on selects from data in client-side JET tables.
Note that I am using recordsets to do these inserts because this was the
easiest way to get the new AutoNumber keys when JET was the back-end, but I
can change that if it'll help, and just use .Execute since I now have to use a
pass-through query to get the new SERIES values with the PostgreSQL back-end,
anyway.
Thanks for any advice anyone has,
- Steve J.
I've migrated an Access database schema to PostgreSQL, and I'm trying to get
everything working again. I'm having the following problem...
Within an Access transaction, I insert a row into one table, then I insert a
row into a table with a foreign key relationship to the first record. The
second insert fails with a referential integrity violation referring to the
same relationhip I mentioned. This worked fine with a JET back-end and the
same relationships.
It's as if my 2 inserts are not using the same connection or something, so my
second insert doesn't "see" the first one since it's not committed yet. All
statements are executed via the same DAO workspace. I'm using DAO because I'm
dealing with heterogenious data, doing things like inserting into PostgreSQL
tables based on selects from data in client-side JET tables.
Note that I am using recordsets to do these inserts because this was the
easiest way to get the new AutoNumber keys when JET was the back-end, but I
can change that if it'll help, and just use .Execute since I now have to use a
pass-through query to get the new SERIES values with the PostgreSQL back-end,
anyway.
Thanks for any advice anyone has,
- Steve J.
Comment