]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/sup.php
PostgreSQL - a few more query compatibility issues (submitted by oxygene)
[quix0rs-gnu-social.git] / actions / sup.php
index f4b1cda230ef3776370aeb09217c548df11b7835..8ef9207facce41d02ac44d00ce771ec38df39720 100644 (file)
@@ -65,7 +65,9 @@ class SupAction extends Action
 
         $notice->query('SELECT profile_id, max(id) AS max_id ' .
                        'FROM notice ' .
-                       'WHERE created > (now() - ' . $seconds . ') ' .
+                        ((common_config('db','type') == 'pgsql') ?
+                       'WHERE extract(epoch from created) > (extract(epoch from now()) - ' . $seconds . ') ' :
+                       'WHERE created > (now() - ' . $seconds . ') ' ) .
                        'GROUP BY profile_id');
 
         $updates = array();