A preinstall of drupal4.7-rc2 fails on postgresql database setup:

I created the database drupal4.7 following the INSTALL.pgsql.txt and then:

postgres@linux:/srv/www/htdocs/drupal-4-7-0-rc2> psql -q -f database/database.pgsql drupal4.7 drupal
psql:database/database.pgsql:878: ERROR: parser: parse error at or near "SEQUENCE" at character 7
psql:database/database.pgsql:905: ERROR: Type "anyelement" does not exist

My postgresql-version (SUSE 9.0):
linux:/srv/www/htdocs/drupal-4-7-0-rc2 # psql -V
psql (PostgreSQL) 7.3.10

The drupal requirements tell it's ok to use postgresql version>=7.3 so this should work....

CommentFileSizeAuthor
#2 pgsql_7.3_compatibility-58113_0.diff.txt2.53 KBCvbge

Comments

peterdd’s picture

and here the lines of database/database.pgsql that provokes the errors:
876 --- Alter some sequences
877 ---
878 ALTER SEQUENCE menu_mid_seq RESTART 3;

903 CREATE OR REPLACE FUNCTION "if"(boolean, anyelement, anyelement) RETURNS anyelement AS '
904 SELECT CASE WHEN $1 THEN $2 ELSE $3 END;
905 ' LANGUAGE 'sql';

Cvbge’s picture

Assigned: Unassigned »
Status: Active » Needs review
StatusFileSize
new2.53 KB

Hi, thanks you for your report.

Please try attache patch, it should fix the problems.

It changes the IF() function to use "text" and "integer" types instead of "anyelement" which does not exists in postgres 7.3.
It also changes the way that "Primary links" menu is inserted, thus removing the need for ALTER SEQUENCE which also does not exists in postgres 7.3 [in fact, it could be done easier, but I don't know if mid column in menu table can contain 0 as correct value or not]

Also adds a case to prefix.sh as side effect (" DEFAULT nextval('")

adrinux’s picture

This patch appears to cause no problems with pgsql 8.07, I was able to complete the installation process without errors.

adrian’s picture

Tested and works on postgres 8.0.1.

I also tested the forum module, which is the only occurence of the function.

it is used to generate the forum listing.

killes@www.drop.org’s picture

Status: Needs review » Fixed

I've applied the patch. No idea if it fixes pgsql 7.3. I am ok with not supporting it if it doesn't.

Anonymous’s picture

Status: Fixed » Closed (fixed)