diff options
Diffstat (limited to 'functions.php')
-rw-r--r-- | functions.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/functions.php b/functions.php index be95caa04..14d9fa154 100644 --- a/functions.php +++ b/functions.php @@ -24,7 +24,9 @@ (SELECT date_entered FROM ttrss_entries WHERE id = ref_id) < NOW() - INTERVAL '$purge_interval days'"); */ - if (PG_VERSION == "7.4" || PG_VERSION == "8.0") { + $pg_version = get_pgsql_version($link); + + if (preg_match("/^7\./", $pg_version) || preg_match("/^8\.0/", $pg_version)) { $result = db_query($link, "DELETE FROM ttrss_user_entries WHERE ttrss_entries.id = ref_id AND @@ -1490,4 +1492,10 @@ } } + function get_pgsql_version($link) { + $result = db_query($link, "SELECT version() AS version"); + $version = split(" ", db_fetch_result($result, 0, "version")); + return $version[1]; + } + ?> |