]> granicus.if.org Git - postgresql/commit
Fix psql lexer to avoid use of backtracking.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 25 Aug 2011 18:33:08 +0000 (14:33 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 25 Aug 2011 18:33:25 +0000 (14:33 -0400)
commitbe93200c76911047dcb94ddb696441ecdef9a3cb
tree74d893ec5101caebed548adbed8854201acfc3ea
parentde632180ed51b8a6ff275a5f81198521e8b30e12
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.
src/bin/psql/psqlscan.l