Fix psql lexer to avoid use of backtracking.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 9354f5b76acf37c96ed0173ff8ab3e415bae2b04
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2011-08-25T18:33:37Z
Releases: 9.0.5
Fix psql lexer to avoid use of backtracking.

Per previous experimentation, backtracking slows down lexing performance
significantly (by about a third).  It's usually pretty easy to avoid, just
need to have rules that accept an incomplete construct and do whatever the
lexer would have done otherwise.

The backtracking was introduced by the patch that added quoted variable
substitution.  Back-patch to 9.0 where that was added.

Files

PathChange+/−
src/bin/psql/psqlscan.l modified +32 −1