Skip to content
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

Feature Request: Transparent database update support using AXMLS for PostgreSQL #124

Closed
EyeAndTea opened this issue Jun 17, 2015 · 8 comments
Labels
pgsql PostgreSQL (Tier 1) xml schema

Comments

@EyeAndTea
Copy link

The library appears to have come a long way, and looking at the code it appears that it should now be possible to implement a custom version of the "ChangeTableSQL" function for the "ADODB2_postgres" class in 'datadict-postgres.inc.php" using similar methodologies used in AlterColumnSQL, and DropColumnSQL. As things are at the moment, transparent database update using the AXMLS feature on PostgreSQL does not work.

@Mike-Benoit
Copy link
Contributor

It would be helpful if you could include the reason why the base ChangeTableSQL does not work with PostgreSQL or perhaps some example cases of where it falls down. Its been a while since I used AXMLS, but when I was using it (many years ago), it seemed to work fine on PostgreSQL.

@EyeAndTea
Copy link
Author

It produces an error due to syntax. This happens with updating of columns. We think the syntax generated by the default ChangeTableSQL was made to work with as many databases as possible, but the syntax is broken on PostgreSQL. We are working with PostgreSQL 9. We had indication from on line sources that this was always an issue. For example:

"http://adodb-xmlschema.sourceforge.net/docs/index.html"

and

"http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=1756"

Notice how the second link has "Status: RESOLVED FIXED" for the bug. We tracked that fixed code, and it still did not work for us. Perhaps we did not use it correctly or tested the wrong code, we do not know.

There is also indication in the code notes that older versions of PostgresSQL suffered from limitations that gave rise to the need of copying tables over when altering them. This suggested to us that the general code could not have worked with PostgreSQL when modifying tables.

Of course, we could be wrong. What version of PostrgreSQL do you remember AXMLS working for?

EyeAndTea pushed a commit to EyeAndTea/ADOdb that referenced this issue Jun 26, 2015
… the file "datadict-postgres.inc.php". This should add transparent database update support when using ADODB AXMLS. Please note the following:

The function is not to be confused with a general implementation. Do not be tempted to replace it with the same function in "adodb-datadict.inc.php".
The transparent database update for PostgreeSQL has the same limitation that would exist for other databases using ADODB AXMLS.
The function only supports PostgreSQL version 8 and up at the moment.
No attention has been paid to performance yet when implementing the function.

Referencing request "ADOdb#124".
@peterdd
Copy link
Contributor

peterdd commented Jun 8, 2018

@jahto made this https://github.com/Flyspray/flyspray/blob/master/setup/upgrade/1.0/datadict-postgres.inc.php
for overwriting.

Don't know if some of the comments there still apply to current postgresql in 2018 (postgresql10 and newer)

@EyeAndTea
Copy link
Author

Thank you for the update. I am happy the community is still active. The team itself long moved on, and this account is now my personal account. If you wish me to close this issue, or the community wishes to close it, I do not mind, but I could not tell you whether it was indeed fixed or not.

I am still likely to refer to said code in the future, so thank you again.

@jahto
Copy link
Contributor

jahto commented Jun 11, 2018

It seems that datadict-postgres.inc.php still doesn't have the function changeTableSQL, but it could have been fixed some other way. It will take a while, but I'll check this week if the latest version of ADOdb works.

@peterdd
Copy link
Contributor

peterdd commented Mar 6, 2021

I try to pick this up this month @mnewnham @dregad

@mnewnham
Copy link
Contributor

mnewnham commented Sep 7, 2022

This was completed and closed in 5.22.3 by #865

@mnewnham mnewnham closed this as completed Sep 7, 2022
@dregad
Copy link
Member

dregad commented Sep 7, 2022

This was completed and closed in 5.22.3 by #865

OK, I'll add a reference to this issue in the Changelog.

dregad added a commit that referenced this issue Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pgsql PostgreSQL (Tier 1) xml schema
Projects
None yet
Development

No branches or pull requests

6 participants