PostgreSQL-For-Wordpress / postgresql-for-wordpress

A maintained fork of https://wordpress.org/plugins/postgresql-for-wordpress/
GNU General Public License v2.0
230 stars 71 forks source link

Works under WordPress 6.2 #26

Closed piotrmaslanka closed 11 months ago

piotrmaslanka commented 1 year ago

Without any major mishaps. Had to silence errors, since sometimes they fail.

image

My blog is the major example that it works - https://henrietta.com.pl Admin panel works as well. We' ve done it!

Besides @kevinoid the way you approached the problem, this is a way I really like :)

Fixes #25

Verequies commented 1 year ago

Just tried this on my server, but brings me to the installation page every time. What PostgreSQL and PHP versions are you using?

piotrmaslanka commented 1 year ago

I've upgraded my WordPress 5.8 to 6.2 with this, so apparently you can't start off fresh, you need to have a working instance. I'm using PostgreSQL 12-6.1 and PHP 7.4.33.

I haven't tested it with fresh installs, I was just happy to have a working WordPress 6.2 with PgSQL.

Verequies commented 1 year ago

Yeah, that is great you got it working. Unfortunately there seems to be more issues when running WordPress 6.2 with PHP 8.2 and PostgreSQL 15. Was working with PostgreSQL for the most part but since the PHP 8.2 update it is broken. Unable to get it working so will have to move to a different platform than WordPress.

tamama commented 1 year ago

Nope. This is not working.

After patching the obvious (wp-db.php => class-wpdb.php), this generates other issues.

One question though for @kevinoid -- why wouldn't Wordpress adopt Postgres as one of its standard? Since we occupy roughly 20% market share in terms of popularity?

MySQL remains the de-facto choice - I dont disagree because it occupies roughly 45%. ...

For myself, it is unfortunate - because I have to maintain one more ecosystem (MySQL + UI) for Wordpress .. :(

tamama commented 1 year ago

I believe that the more correct design (with minimal maintainance effort) would be:

mattbucci commented 11 months ago

I was able to get both installation and blog + content creation working fine on WP Version 6.3.2

I needed to make substantial changes but this plugin was a good start https://github.com/kevinoid/postgresql-for-wordpress/pull/31

tamama commented 11 months ago

@mattbucci

mattbucci commented 11 months ago

My use case relies on postgres so I don't really have a choice unless I'm going to move away from WordPress entirely, so in this case the cost to adapt WordPress is much cheaper than a rewrite against a different CMS.

What I can say from the many hours I've put in so far though is that WP itself seems to work fine with this plugin's approach, very little of my required changes had to do with updates on the WP side.

The issue however comes from how brittle it is to try to rewrite MySQL queries to postgres using regex.

What would really be needed to do a project like this properly would be a SQL parser in PHP but I have not come across a modern and well maintained parser in PHP, ideally the parser would parse MySQL input to an AST and then output to postgres.

On Sat, Oct 28, 2023 at 4:09 AM Tama MA @.***> wrote:

@mattbucci https://github.com/mattbucci

  • I think the bigger problem here is that the base plugin ( https://wordpress.org/plugins/postgresql-for-wordpress/) has been dead for quite a long time.
  • My 2 cents is to stay away from this mess, otherwise you need to patch-fix for every (few) WP version upgrade(s)
  • My gut feeling is that this would get more and more divergent from WP core.
  • Though I must admit that it is quite a nuissance to maintain MySQL just for the WP ecosystem ...

— Reply to this email directly, view it on GitHub https://github.com/kevinoid/postgresql-for-wordpress/pull/26#issuecomment-1783780378, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZBZMYF4COAM7IGLLH3UOLYBTRXJAVCNFSM6AAAAAAW2ZDCE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBTG44DAMZXHA . You are receiving this because you were mentioned.Message ID: @.***>

tamama commented 11 months ago

@mattbucci

mattbucci commented 11 months ago

Regarding the AST based approach. This is a good reference https://tomassetti.me/parsing-sql/

I don't think the PHP community is a good resource for these sort of parsers, but an implementation of a MySQL server in go using dolt should be possible, and MySQL and postgresql parsers exist in golang so it should be possible to create a sort of MySQL to postgresql bridge but I haven't found any evidence of such a project which seems discouraging.

On Sat, Oct 28, 2023 at 4:28 AM Tama MA @.***> wrote:

@mattbucci https://github.com/mattbucci

  • Totally understand your pain. :)
  • As the saying goes always - there is no free lunch. ... Somehow, somewhere, someone needs to pay the price for this tradeoff ...

— Reply to this email directly, view it on GitHub https://github.com/kevinoid/postgresql-for-wordpress/pull/26#issuecomment-1783784123, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZBZM7GVJGF5Z6RXA6UGXDYBTT5DAVCNFSM6AAAAAAW2ZDCE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBTG44DIMJSGM . You are receiving this because you were mentioned.Message ID: @.***>

mattbucci commented 11 months ago

merged into v1 and v2 branches