-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_seq appended to table name, how to deal with it properly? #99
Comments
basically this is coming from this function: postgresql-for-wordpress/pg4wp/driver_pgsql.php Line 1060 in 23da9c0
the purpose of if I understand correctly in your table this would be object_id, but I'm not sure that this really is an incrementing sequence. It seems that object_id is assigned to $term_id per your above code. wpsqli_insert_id is called somewhere in your code, which should be returning $term_id, but instead is trying to use a sequence value which in your case will fail. It is possible that PGSQL could account for cases like this by appending "RETURNING id" to the end of insert statements like so: #76 (comment) A simpler change may be to implement support for LASTVAL(); in the event that we don't have a matching sequence at all rather than trying to assume $table_seq |
looking into this more last_val is not advisable. Options are:
|
Draft PR Here: #101 |
I dont think its a bug, you are probably intentionally appending "_seq" to the end of the table name, however I have some custom tables, and not sure if I should have prepared them for this operation properly?
Is there something I should do specifically to make this statement work on custom table? As you can see I have some translations relation table.
In my specific case this query is executed when Im saving term meta and modifying term links:
And here is how the tables created:
The text was updated successfully, but these errors were encountered: