diff --git modules/acquia/pathauto/pathauto_node.inc modules/acquia/pathauto/pathauto_node.inc
index 225d37a..b53b34b 100644
--- modules/acquia/pathauto/pathauto_node.inc
+++ modules/acquia/pathauto/pathauto_node.inc
@@ -97,7 +97,9 @@ function node_pathauto_bulkupdate() {
 
   $count = 0;
   if (count($pattern_types)) {
-    $query = "SELECT n.nid, n.vid, n.type, n.title, n.uid, n.created, n.language, alias.src, alias.dst FROM {node} n LEFT JOIN {url_alias} alias ON CONCAT('node/', CAST(n.nid AS CHAR)) = alias.src WHERE alias.src IS NULL AND n.type IN (". db_placeholders($pattern_types, 'varchar') .')';
+    global $db_type;
+    $cast = ($db_type == 'pgsql') ? 'TEXT' : 'CHAR';
+    $query = "SELECT n.nid, n.vid, n.type, n.title, n.uid, n.created, n.language, alias.src, alias.dst FROM {node} n LEFT JOIN {url_alias} alias ON CONCAT('node/', CAST(n.nid AS $cast)) = alias.src WHERE alias.src IS NULL AND n.type IN (". db_placeholders($pattern_types, 'varchar') .')';
     $result = db_query_range($query, $pattern_types, 0, variable_get('pathauto_max_bulk_update', 50));
 
     $placeholders = array();
diff --git modules/acquia/pathauto/pathauto_taxonomy.inc modules/acquia/pathauto/pathauto_taxonomy.inc
index 132609d..2254720 100644
--- modules/acquia/pathauto/pathauto_taxonomy.inc
+++ modules/acquia/pathauto/pathauto_taxonomy.inc
@@ -80,7 +80,9 @@ function taxonomy_pathauto_bulkupdate() {
   // Exclude the forums and join all the args into one array so they can be passed to db_query
   $forum_vid[] = variable_get('forum_nav_vocabulary', '');
   $query_args = array_merge($forum_vid, $pattern_vids);
-  $query = "SELECT tid, vid, name, src, dst FROM {term_data} LEFT JOIN {url_alias} ON CONCAT('taxonomy/term/', CAST(tid AS CHAR)) = src WHERE src IS NULL AND vid <> %d ". $vid_where;
+  global $db_type;
+  $cast = ($db_type == 'pgsql') ? 'TEXT' : 'CHAR';
+  $query = "SELECT tid, vid, name, src, dst FROM {term_data} LEFT JOIN {url_alias} ON CONCAT('taxonomy/term/', CAST(tid AS $cast)) = src WHERE src IS NULL AND vid <> %d ". $vid_where;
   $result = db_query_range($query, $query_args, 0, variable_get('pathauto_max_bulk_update', 50));
 
   $count = 0;
@@ -155,8 +157,10 @@ function forum_pathauto($op) {
  * Generate aliases for all forums and forum containers without aliases.
  */
 function forum_pathauto_bulkupdate() {
+  global $db_type;
+  $cast  = ($db_type == 'pgsql') ? 'TEXT' : 'CHAR';
   $forum_vid = variable_get('forum_nav_vocabulary', '');
-  $query = "SELECT tid, vid, name, src, dst FROM {term_data} LEFT JOIN {url_alias} ON CONCAT('forum/', CAST(tid AS CHAR)) = src WHERE vid = %d AND src IS NULL";
+  $query = "SELECT tid, vid, name, src, dst FROM {term_data} LEFT JOIN {url_alias} ON CONCAT('forum/', CAST(tid AS $cast)) = src WHERE vid = %d AND src IS NULL";
   $result = db_query_range($query, $forum_vid, 0, variable_get('pathauto_max_bulk_update', 50));
 
   $count = 0;
diff --git modules/acquia/pathauto/pathauto_user.inc modules/acquia/pathauto/pathauto_user.inc
index 4540dd9..2d48e62 100644
--- modules/acquia/pathauto/pathauto_user.inc
+++ modules/acquia/pathauto/pathauto_user.inc
@@ -91,7 +91,9 @@ function tracker_pathauto($op) {
  * Bulk generate aliases for all users without aliases.
  */
 function user_pathauto_bulkupdate() {
-  $query = "SELECT uid, name, src, dst FROM {users} LEFT JOIN {url_alias} ON CONCAT('user/', CAST(uid AS CHAR)) = src WHERE uid > 0 AND src IS NULL";
+  global $db_type;
+  $cast = ($db_type == 'pgsql') ? 'TEXT' : 'CHAR';
+  $query = "SELECT uid, name, src, dst FROM {users} LEFT JOIN {url_alias} ON CONCAT('user/', CAST(uid AS $cast)) = src WHERE uid > 0 AND src IS NULL";
   $result = db_query_range($query, 0, variable_get('pathauto_max_bulk_update', 50));
 
   $count = 0;
@@ -113,7 +115,9 @@ function user_pathauto_bulkupdate() {
  * Bulk generate aliases for all blogs without aliases.
  */
 function blog_pathauto_bulkupdate() {
-  $query = "SELECT uid, name, src, dst FROM {users} LEFT JOIN {url_alias} ON CONCAT('blog/', CAST(uid AS CHAR)) = src WHERE uid > 0 AND src IS NULL";
+  global $db_type;
+  $cast = ($db_type == 'pgsql') ? 'TEXT' : 'CHAR';
+  $query = "SELECT uid, name, src, dst FROM {users} LEFT JOIN {url_alias} ON CONCAT('blog/', CAST(uid AS $cast)) = src WHERE uid > 0 AND src IS NULL";
   $result = db_query_range($query, 0, variable_get('pathauto_max_bulk_update', 50));
 
   $count = 0;
@@ -137,7 +141,9 @@ function blog_pathauto_bulkupdate() {
 function tracker_pathauto_bulkupdate() {
   // We do the double CONCAT because Pgsql8.1 doesn't support more than three arguments to CONCAT
   // Hopefully some day we can remove that.
-  $query = "SELECT uid, name, src, dst FROM {users} LEFT JOIN {url_alias} ON CONCAT(CONCAT('user/', CAST(uid AS CHAR)), '/track') = src WHERE uid > 0 AND src IS NULL";
+  global $db_type;
+  $cast = ($db_type == 'pgsql') ? 'TEXT' : 'CHAR';
+  $query = "SELECT uid, name, src, dst FROM {users} LEFT JOIN {url_alias} ON CONCAT(CONCAT('user/', CAST(uid AS $cast)), '/track') = src WHERE uid > 0 AND src IS NULL";
   $result = db_query_range($query, 0, variable_get('pathauto_max_bulk_update', 50));
 
   $count = 0;
