public function set($key, $value, $expire = 0)
{
// PostgreSQL doesn't have a decent UPSERT (like REPLACE or even INSERT
// ... ON DUPLICATE KEY UPDATE ...); here's a "works for all" downgrade
$success = $this->add($key, $value, $expire);
if ($success) {
return true;
}
$success = $this->replace($key, $value, $expire);
if ($success) {
return true;
}
return false;
}