The installer is failing immediately after db credentials with the follow error:

  • Failed to create a test table on your PostgreSQL database server with the command CREATE TABLE drupal_install_test (id int NULL). PostgreSQL reports the following message: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ""UTF8""
    LINE 1: SET NAMES "UTF8"
    ^
    .
    • Are you sure the configured username has the necessary PostgreSQL permissions to create tables in the database?

    For more help, see the Installation and upgrading handbook. If you are unsure what these terms mean you should probably contact your hosting provider.

  • Failed to insert a value into a test table on your PostgreSQL database server. We tried inserting a value with the command INSERT INTO drupal_install_test (id) VALUES (1) and PostgreSQL reported the following error: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ""UTF8""
    LINE 1: SET NAMES "UTF8"
    ^
    .
  • Failed to update a value in a test table on your PostgreSQL database server. We tried updating a value with the command UPDATE drupal_install_test SET id = 2 and PostgreSQL reported the following error: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ""UTF8""
    LINE 1: SET NAMES "UTF8"
    ^
    .
  • Failed to delete a value from a test table on your PostgreSQL database server. We tried deleting a value with the command DELETE FROM drupal_install_test and PostgreSQL reported the following error: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ""UTF8""
    LINE 1: SET NAMES "UTF8"
    ^
    .
  • Failed to drop a test table from your PostgreSQL database server. We tried dropping a table with the command DROP TABLE drupal_install_test and PostgreSQL reported the following error SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ""UTF8""
    LINE 1: SET NAMES "UTF8"
    ^
    .

Comments

josh waihi’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new787 bytes

quick fix for this - Use syntax that postgreSQL likes. I've tested this. It works

josh waihi’s picture

Issue tags: +Quick fix

tagging as brain dead commit-able patch

mikey_p’s picture

Confirming this fixed the error.

damien tournoud’s picture

Erm. SET NAMES "UTF8" is listed as a valid syntax on [1].

Is that the double quotes that PostgreSQL dislike in the SET NAMES syntax? If so, why in hell does it accept it on SET client_encoding TO?

[1] http://www.postgresql.org/docs/8.3/static/multibyte.html

damien tournoud’s picture

Status: Reviewed & tested by the community » Needs work

Well, I confirms that:

SET client_encoding TO "UTF8"; // Works
SET NAMES "UTF8"; // Fails

SET client_encoding TO 'UTF8'; // Works
SET NAMES 'UTF8'; // Works

If I believe the PostgreSQL manual, the version with single quotes is the preferred one. Let's use this one.

josh waihi’s picture

Status: Needs work » Needs review
StatusFileSize
new774 bytes

This seems to be an issue from #319165: postgresql explicit encoding set where the patch wasn't tested but commited instead. I've changed the quoting so the previous syntax works

damien tournoud’s picture

Status: Needs review » Reviewed & tested by the community

My fault, I greenlighted the patch on the other issue without testing it. I should be more cautious: PostgreSQL is mercyless. Tested this time.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

liam morland’s picture

Issue tags: +PostgreSQL