diff --git a/src/Adapters/PostgreSQL.php b/src/Adapters/PostgreSQL.php
index <HASH>..<HASH> 100644
--- a/src/Adapters/PostgreSQL.php
+++ b/src/Adapters/PostgreSQL.php
@@ -19,6 +19,31 @@ class PostgreSQL extends SQL
     {
         return $this->client->exec("TRUNCATE TABLE $this->table") !== false;
     }
+    
+    /**
+     * {@inheritdoc}
+     */
+    public function set($key, $value, $expire = 0)
+    {
+        $value = $this->serialize($value);
+        $expire = $this->expire($expire);
+
+        $this->clearExpired();
+
+        $statement = $this->client->prepare(
+            "INSERT INTO $this->table (k, v, e)
+            VALUES (:key, :value, :expire) 
+            ON CONFLICT (k) DO UPDATE SET v=EXCLUDED.v, e=EXCLUDED.e"
+        );
+
+        $statement->execute([
+            ':key' => $key,
+            ':value' => $value,
+            ':expire' => $expire,
+        ]);
+
+        return $statement->rowCount() === 1;
+    }
 
     /**
      * {@inheritdoc}
Postgres set on conflict update

Since version <I> postgres (<I> latest) has on conflict update set syntax. This syntax avoids lots of error record in postgres logs (duplicate key error).

<URL>