diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,14 @@
 `wai-rate-limit-postgres` uses [PVP Versioning][1].
 The changelog is available [on GitHub][2].
 
+## 0.2.0.0
+
+* Fix bug in table name reference (#1)
+
+## 0.1.0.0
+
+Initial release
+
 ## 0.0.0.0
 
 * Initially created.
diff --git a/src/Network/Wai/RateLimit/Postgres.hs b/src/Network/Wai/RateLimit/Postgres.hs
--- a/src/Network/Wai/RateLimit/Postgres.hs
+++ b/src/Network/Wai/RateLimit/Postgres.hs
@@ -100,10 +100,11 @@
             " "
             [ "INSERT INTO",
               tableName,
+              "as rl",
               "(key, usage) VALUES (?, ?)",
               "ON CONFLICT (key) DO UPDATE SET",
-              "usage = CASE WHEN rate_limiter.expires_at > CURRENT_TIMESTAMP THEN rate_limiter.usage + EXCLUDED.usage ELSE EXCLUDED.usage END,",
-              "expires_at = CASE WHEN rate_limiter.expires_at > CURRENT_TIMESTAMP THEN rate_limiter.expires_at ELSE CURRENT_TIMESTAMP + '1 week'::INTERVAL END",
+              "usage = CASE WHEN rl.expires_at > CURRENT_TIMESTAMP THEN rl.usage + EXCLUDED.usage ELSE EXCLUDED.usage END,",
+              "expires_at = CASE WHEN rl.expires_at > CURRENT_TIMESTAMP THEN rl.expires_at ELSE CURRENT_TIMESTAMP + '1 week'::INTERVAL END",
               "RETURNING usage"
             ]
 
diff --git a/test/Spec.hs b/test/Spec.hs
--- a/test/Spec.hs
+++ b/test/Spec.hs
@@ -37,7 +37,7 @@
 mkTestWaiApp :: Integer -> Integer -> ByteString -> IO Wai.Application
 mkTestWaiApp seconds limit key = do
   pool <- mkConnPool
-  pgBackend <- postgresBackend pool "rate_limiter"
+  pgBackend <- postgresBackend pool "rate_limiter_1"
   let app _ respond = respond $ Wai.responseLBS status200 [] "Ok!"
       strategy = R.fixedWindow pgBackend seconds limit (const $ return key)
       middleware = R.rateLimiting strategy
diff --git a/wai-rate-limit-postgres.cabal b/wai-rate-limit-postgres.cabal
--- a/wai-rate-limit-postgres.cabal
+++ b/wai-rate-limit-postgres.cabal
@@ -1,6 +1,6 @@
 cabal-version:       3.0
 name:                wai-rate-limit-postgres
-version:             0.1.0.0
+version:             0.2.0.0
 category:            Security, Web, Network
 synopsis:            See README for more info
 description:
@@ -23,7 +23,7 @@
   location:            https://github.com/donatello/wai-rate-limit-postgres.git
 
 common common-options
-  build-depends:       base >= 4.14.3.0 && < 4.16
+  build-depends:       base >= 4.12 && < 5
                      , relude ^>= 1.0
                      , wai-rate-limit ^>= 0.1.0.0
                      , postgresql-simple ^>= 0.6
