-
- Downloads
"...postgres-lambda-diff.git" did not exist on "1b2ebc591cf56cf5a6b93a4993e135fa1d02e1f1"
Revise plpgsql's scanner to process comments and string literals in a way
more nearly matching the core SQL scanner. The user-visible effects are: * Block comments (slash-star comments) now nest, as per SQL spec. * In standard_conforming_strings mode, backslash as the last character of a non-E string literal is now correctly taken as an ordinary character; formerly it was misinterpreted as escaping the ending quote. (Since the string also had to pass through the core scanner, this invariably led to syntax errors.) * Formerly, backslashes in the format string of RAISE were always treated as quoting the next character, regardless of mode. Now, they are ordinary characters with standard_conforming_strings on, while with it off, they introduce the same set of escapes as in the core SQL scanner. Also, escape_string_warning is now effective for RAISE format strings. These changes make RAISE format strings work just like any other string literal. This is implemented by copying and pasting a lot of logic from the core scanner. It would be a good idea to look into getting rid of plpgsql's scanner entirely in favor of using the core scanner. However, that involves more change than I can justify making during beta --- in particular, the core scanner would have to become re-entrant. In passing, remove the kluge that made the plpgsql scanner emit T_FUNCTION or T_TRIGGER as a made-up first token. That presumably had some value once upon a time, but now it's just useless complication for both the scanner and the grammar.
Showing
- doc/src/sgml/plpgsql.sgml 3 additions, 5 deletionsdoc/src/sgml/plpgsql.sgml
- src/pl/plpgsql/src/gram.y 51 additions, 12 deletionssrc/pl/plpgsql/src/gram.y
- src/pl/plpgsql/src/pl_comp.c 9 additions, 9 deletionssrc/pl/plpgsql/src/pl_comp.c
- src/pl/plpgsql/src/pl_funcs.c 38 additions, 1 deletionsrc/pl/plpgsql/src/pl_funcs.c
- src/pl/plpgsql/src/plpgsql.h 4 additions, 4 deletionssrc/pl/plpgsql/src/plpgsql.h
- src/pl/plpgsql/src/scan.l 178 additions, 205 deletionssrc/pl/plpgsql/src/scan.l
- src/test/regress/expected/plpgsql.out 71 additions, 0 deletionssrc/test/regress/expected/plpgsql.out
- src/test/regress/sql/plpgsql.sql 44 additions, 0 deletionssrc/test/regress/sql/plpgsql.sql
Loading
Please register or sign in to comment