Title: Problem with update + order by.
Last modified: November 27, 2020

---

# Problem with update + order by.

 *  [0kasper](https://wordpress.org/support/users/0kasper/)
 * (@0kasper)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/problem-with-update-order-by/)
 * Hi!
 * While are using this plugin, I’ve a problem with editing pages.
 * In PG4WP logs I found this:
 * ———————
    [1606512645.3863] Error running : SELECT p.ID FROM wp_posts p WHERE 
   post_type=’scheduled-action’ AND p.post_status=’pending’ AND p.post_modified_gmt
   <= ‘2020-11-27 21:25:45′ AND p.post_password != ” ORDER BY p.post_date_gmt ASC
   LIMIT 0, 20 —- converted to —- SELECT p.”ID” FROM wp_posts p WHERE post_type=’
   scheduled-action’ AND p.post_status=’pending’ AND p.post_modified_gmt <= ‘2020-
   11-27 21:25:45’ AND p.post_password <> 0 ORDER BY p.post_date_gmt ASC LIMIT 20
   OFFSET 0 —-> ERROR: operator does not exist: character varying <> integer LINE
   1: …_gmt <= ‘2020-11-27 21:25:45’ AND p.post_password <> 0 ORDER… ^ HINT: No 
   operator matches the given name and argument types. You might need to add explicit
   type casts. ——————— [1606512645.4773] Error running : UPDATE wp_posts SET post_password
   = ‘c259d5877cdad7210992’, post_modified_gmt = ‘2020-11-27 21:30:45’, post_modified
   = ‘2020-11-27 22:30:45’ WHERE post_type = ‘scheduled-action’ AND post_status 
   = ‘pending’ AND post_password = ” AND post_date_gmt <= ‘2020-11-27 21:30:45’ 
   ORDER BY menu_order ASC, post_date_gmt ASC, ID ASC LIMIT 25 —- converted to —-
   UPDATE wp_posts SET post_password = ‘c259d5877cdad7210992’, post_modified_gmt
   = ‘2020-11-27 21:30:45’, post_modified = ‘2020-11-27 22:30:45’ WHERE post_type
   = ‘scheduled-action’ AND post_status = ‘pending’ AND post_password = ” AND post_date_gmt
   <= ‘2020-11-27 21:30:45’ ORDER BY menu_order ASC, post_date_gmt ASC, ID ASC —-
   > ERROR: syntax error at or near “ORDER” LINE 1: …d = ” AND post_date_gmt <= ‘
   2020-11-27 21:30:45’ ORDER BY m… ^ ———————
 * Any one have fix for that?

The topic ‘Problem with update + order by.’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/postgresql-for-wordpress.svg)
 * [PostgreSQL for WordPress (PG4WP)](https://wordpress.org/plugins/postgresql-for-wordpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/postgresql-for-wordpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/postgresql-for-wordpress/)
 * [Active Topics](https://wordpress.org/support/plugin/postgresql-for-wordpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/postgresql-for-wordpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/postgresql-for-wordpress/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [0kasper](https://wordpress.org/support/users/0kasper/)
 * Last activity: [5 years, 5 months ago](https://wordpress.org/support/topic/problem-with-update-order-by/)
 * Status: not resolved