Ticket #1614 (new defect)

Opened 6 years ago

Last modified 6 years ago

rewriteCountQuery($sql) update for postgresql

Reported by: 42nato Assigned to: 42nato
Priority: low Milestone:
Component: SGL - DB Severity: open
Keywords: postgresql Cc:


I had to modify the regular expression pattern for postgresql queries selecting substrings: //$queryCount = preg_replace('/(?:.*)\bFROM\b\s+/Uims', 'SELECT COUNT(*) FROM ', $sql, 1); $queryCount = preg_replace('/(?:.*)\bFROM\b[0-9]\s+/Uims', 'SELECT COUNT(*) FROM ', $sql, 1);

For now this solves my problems.

Syntax: substring('Thomas' from 2 for 3)

@see http://www.postgresql.org/docs/8.3/static/functions-string.html

Change History

04/15/08 06:16:58 changed by demian

  • owner changed from somebody to 42nato.

Hi 42nato

thanks for the suggestion, do you want to create a patch that implements your idea? pls attach to this ticket.