Hay,

I tired to use the module and got the following errors:

    * warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "REGEXP" LINE 1: ..., n.title AS node_title FROM node n WHERE n.title REGEXP 'AC... ^ in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\d6test\includes\database.pgsql.inc on line 139.
    * user warning: query: SELECT n.nid, n.title AS node_title FROM node n WHERE n.title REGEXP 'AC_TEMPLATE' ORDER BY n.title in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\d6test\sites\all\modules\autocreate\autocreate.module on line 229.

OK - hope this helps you in development. If it's not a pg related error it might be the ANC doesn't play nice with auto node title or noderreferrer_create.

Cheers,

V

Comments

sunset_bill’s picture

Title: postgres incompatability » postgres incompatability?
Assigned: Unassigned » sunset_bill

Hmmm, good one, thanks. It turns out postgres does pattern matching differently than mysql so changed

$result = db_query("SELECT n.nid, n.title AS node_title FROM {node} n WHERE n.title REGEXP '%s' ORDER BY n.title", $template_token);

to

  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $result = db_query("SELECT n.nid, n.title AS node_title FROM {node} n WHERE n.title REGEXP '%s$' ORDER BY n.title", $template_token);
    break;
    case 'pgsql':
      $result = db_query("SELECT n.nid, n.title AS node_title FROM {node} n WHERE n.title ~* '%s$' ORDER BY n.title", $template_token);
    break;
  }

in 2.x for both D5 and D6--changes will be available when the 18 Feb dev releases happen. It's still working OK in MySQL but I don't have a Postgres installation to test on. Please try it out and let me know.

cheers,
Bill

VeeLin’s picture

Thanks for the quick reply. Sorry I was out of town but I'll try to test this soon.

Cheers,

V

sunset_bill’s picture

De nada.

Having a bit of trouble with the 2.x dev snapshots, but I've made a 6.x-1.2 release that should address the postgres problem (until you run into the next one ;^) ).

sunset_bill’s picture

Status: Active » Closed (fixed)

2 weeks w/o activity