diff --git a/Database/Persist/Postgresql.hs b/Database/Persist/Postgresql.hs
--- a/Database/Persist/Postgresql.hs
+++ b/Database/Persist/Postgresql.hs
@@ -5,6 +5,7 @@
 {-# LANGUAGE TypeFamilies #-}
 {-# LANGUAGE DeriveDataTypeable #-}
 {-# LANGUAGE ViewPatterns #-}
+{-# LANGUAGE Rank2Types #-}
 
 -- | A postgresql backend for persistent.
 module Database.Persist.Postgresql
@@ -15,6 +16,8 @@
     , ConnectionString
     , PostgresConf (..)
     , openSimpleConn
+    , tableName
+    , fieldName
     ) where
 
 import Database.Persist.Sql
@@ -830,6 +833,22 @@
     , " DROP CONSTRAINT "
     , escape cname
     ]
+
+-- | get the SQL string for the table that a PeristEntity represents
+-- Useful for raw SQL queries
+tableName :: forall record.
+          ( PersistEntity record
+          , PersistEntityBackend record ~ SqlBackend
+          ) => record -> Text
+tableName = escape . tableDBName
+
+-- | get the SQL string for the field that an EntityField represents
+-- Useful for raw SQL queries
+fieldName :: forall record typ.
+          ( PersistEntity record
+          , PersistEntityBackend record ~ SqlBackend
+          ) => EntityField record typ -> Text
+fieldName = escape . fieldDBName
 
 escape :: DBName -> Text
 escape (DBName s) =
diff --git a/persistent-postgresql.cabal b/persistent-postgresql.cabal
--- a/persistent-postgresql.cabal
+++ b/persistent-postgresql.cabal
@@ -1,5 +1,5 @@
 name:            persistent-postgresql
-version:         2.1.1
+version:         2.1.2
 license:         MIT
 license-file:    LICENSE
 author:          Felipe Lessa, Michael Snoyman <michael@snoyman.com>
