You are here

function db_check_setup in Drupal 5

Same name and namespace in other branches
  1. 4 includes/database.pgsql.inc \db_check_setup()
  2. 6 includes/database.pgsql.inc \db_check_setup()

Verify if the database is set up correctly.

Related topics

1 call to db_check_setup()
system_settings_overview in modules/system/system.module
Menu callback; displays a module's settings page.
1 string reference to 'db_check_setup'
system_settings_overview in modules/system/system.module
Menu callback; displays a module's settings page.

File

includes/database.pgsql.inc, line 400
Database interface code for PostgreSQL database servers.

Code

function db_check_setup() {
  $t = get_t();
  $encoding = db_result(db_query('SHOW server_encoding'));
  if (!in_array(strtolower($encoding), array(
    'unicode',
    'utf8',
  ))) {
    drupal_set_message($t('Your PostgreSQL database is set up with the wrong character encoding (%encoding). It is possible it will not work as expected. It is advised to recreate it with UTF-8/Unicode encoding. More information can be found in the <a href="@url">PostgreSQL documentation</a>.', array(
      '%encoding' => $encoding,
      '@url' => 'http://www.postgresql.org/docs/7.4/interactive/multibyte.html',
    )), 'status');
  }
}