summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorCiaranG <ciaran@ciarang.com>2009-03-11 23:41:30 +0000
committerCiaranG <ciaran@ciarang.com>2009-03-11 23:46:23 +0000
commitc08e4d904ec80144379c5728e2274e3513e6c819 (patch)
tree082dfda16ba3049affaff02716b897d24feeba65 /classes
parent70d5fc46845804507640e354c9d9e06367a53fb0 (diff)
PostgreSQL - a few more query compatibility issues (submitted by oxygene)
Diffstat (limited to 'classes')
-rw-r--r--classes/Notice.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 1e3b330f2..3087e39a7 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -232,7 +232,11 @@ class Notice extends Memcached_DataObject
$notice = new Notice();
$notice->profile_id = $profile_id;
$notice->content = $content;
- $notice->whereAdd('now() - created < ' . common_config('site', 'dupelimit'));
+ if (common_config('db','type') == 'pgsql')
+ $notice->whereAdd('extract(epoch from now() - created) < ' . common_config('site', 'dupelimit'));
+ else
+ $notice->whereAdd('now() - created < ' . common_config('site', 'dupelimit'));
+
$cnt = $notice->count();
return ($cnt == 0);
}