Added fixes for postgresql to support version 12 and higher. I checked that it seems to work even better than the driver for mysql. The mysql driver does not support tables without a primary key, but the postgresql driver does. The transition from hidden oid fields to ctid is performed. Checked everything seems to work.
changed title from Added kexi hotfix to support versions 12 and higher, fixing issue #15 to WIP: Added kexi hotfix to support versions 12 and higher, fixing issue #155 months ago
Added changes. It is still under development. It is necessary to improve the work with tables without a primary key. So far, there are problems with editing and deleting added rows in tables without a primary key.
Hmm, there is another idea, to use xmin for indication, instead of ctid. I even made a working implementation. What do you think is best to use? I am attaching a patch of changes for xmin.
In any case, if you use ctid, you will also need to get the value in the request. The CURRVAL() function is not suitable for tables without a primary key. Therefore, it will be necessary to return the result of the INSERT INTO command in the same way, as it was done in the patch that I attached.
Using xmin requires fewer code changes.
I guess it's better to use xmin all the same, since it doesn't change if someone executes VACUUM FULL. I think that I will add a check to the xmin patch to determine the postgresql version and select the oid column for older versions.
Both ctid and xmin have 1 minus, when the rows are updated, the values of xmin and ctid change. Added and deleted lines are not affected, but modified ones are affected. Therefore, for tables that do not have a primary key, after changing the rows, you must close and reopen the tab with the table. But since the order is not important for rows that do not have a primary key, you can simply delete unnecessary rows and add new ones, then there is no need to update the table.
For history, I added patch files, for both implementations.