I would like to use Drupal for Facebook in a site which uses PostgreSQL. I boldly installed 7.x-4.x-dev but soon discovered that many requests which touch the database (e.g. admin/config/fb/settings/app) generate SQL errors, e.g.:
PDOException: SQLSTATE[42804]: Datatype mismatch: 7 ERROR: argument of WHERE must be type boolean, not type integer LINE 1: SELECT * FROM fb_application WHERE status & '1' ^: SELECT * FROM {fb_application} WHERE status & :is_enabled; Array ( [:is_enabled] => 1 ) in fb_admin_all_apps() (line 1215 of /opt/drupal/home/sites/all/modules/fb/fb.admin.inc).
Looking at the code in sites/all/modules/fb/fb.admin.inc revealed the culprit:
$result = db_query("SELECT * FROM {fb_application} WHERE status & :is_enabled", array(
':is_enabled' => FB_STATUS_APP_ENABLED,
));
This issue is documented in https://www.drupal.org/node/555540. The '&' operator in the WHERE clause returns an integer but PostgreSQL requires a boolean in a WHERE clause, hence the error above.
Could someone confirm my analysis?
Steve