I'm using Postgres 8.3.1

After installing some modules, i have this message:

warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "REGEXP" at character 942 in /var/www/drupal-prod/includes/database.pgsql.inc on line 138.
user warning: ERROR: syntax error at or near "REGEXP" at character 942 query: ( SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.title, m.title_callback, m.title_arguments, m.type, ml.* FROM menu_links ml LEFT JOIN menu_router m ON m.path = ml.router_path WHERE ml.menu_name = 'navigation' AND ml.plid IN (1, 10, 17, 16, 18, 21, 40) ) UNION ( SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.title, m.title_callback, m.title_arguments, m.type, ml.menu_name, ml.mlid + 100000 as mlid, ml.plid, ml.link_path, ml.router_path, m.title as link_title, ml.options, ml.module, ml.hidden, ml.external, ml.has_children, ml.expanded, ml.weight, ml.depth + 1 as depth, ml.customized, ml.p1, ml.p2, ml.p3, ml.p4, ml.p5, ml.p6, ml.p7, ml.p8, ml.p9, ml.updated FROM menu_router m LEFT JOIN menu_links ml ON ml.router_path = m.tab_parent WHERE ml.router_path REGEXP '[^%]*' AND m.path LIKE 'admin/%' AND m.type IN (128,136) ) ORDER BY p1 ASC, p2 ASC, p3 ASC, p4 ASC, p5 ASC, p6 ASC, p7 ASC, p8 ASC, p9 ASC in /var/www/drupal-prod/sites/all/modules/admin_menu/admin_menu.inc on line 92.

Don't know if have to do anything with this http://drupal.org/node/220064

Thks

Comments

drupallfm’s picture

I figure out (I think) that the problem is the REGEXP, it should be LIKE
(Regexp is for MySQL, isn't it?)

tried to build a quick test,

inserted this before line 138 in database.pgsql.inc
$query=str_replace("REGEXP","LIKE",$query);

and seems to work.

This IS NOT A FIX, what is necessary now is to discover where the REGEXP is coded ...

As I said, this appears when we click the button "save configuration" in the modules, example Add a new module and save configuration

It seems an easy task, find where this SQL statement is coded and then how REGEXP is inserted and correct it... but still wonder where it is...

Some one to help?

damien tournoud’s picture

Title: Postgres Error » REGEXP is not a valid PostgreSQL construct
Project: Drupal core » Administration menu
Version: 6.2 » 6.x-1.x-dev
Component: database system » Code

I think Drupal Administration Menu is a good guess.

drupallfm’s picture

Is indeed a good guess, find it!

I will report this bug to the administration menu module.

Thks

sun’s picture

Status: Active » Fixed

admin_menu no longer uses REGEXP in the latest release.

drupallfm’s picture

Tested, and it works fine.
Thks

Anonymous’s picture

Status: Fixed » Closed (fixed)

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