PostgreSQL-For-Wordpress / postgresql-for-wordpress

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

utc_timestamp() does not exist in postgres #128

Closed mattbucci closed 1 month ago

mattbucci commented 1 month ago

WP Version: 6.6.2 PG4WP Version: 3.3.1

Error:

utc_timestamp()
                                                             ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

RAW SQL

INSERT INTO wp_gf_form(title, date_created) VALUES('Test', utc_timestamp())
SELECT utc_timestamp()

Expected Rewritten SQL

INSERT INTO wp_gf_form(title, date_created) VALUES('Test', CURRENT_TIMESTAMP AT TIME ZONE 'UTC') RETURNING *
SELECT CURRENT_TIMESTAMP AT TIME ZONE 'UTC'

Actual Rewritten SQL

INSERT INTO wp_gf_form(title, date_created) VALUES('Test', utc_timestamp()) RETURNING *
SELECT utc_timestamp()