Index: doc/src/sgml/syntax.sgml =================================================================== RCS file: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v retrieving revision 1.99 diff -c -c -r1.99 syntax.sgml *** doc/src/sgml/syntax.sgml 23 Dec 2004 05:37:40 -0000 1.99 --- doc/src/sgml/syntax.sgml 28 May 2005 14:02:58 -0000 *************** *** 254,270 **** Another PostgreSQL extension is that ! C-style backslash escapes are available: ! \b is a backspace, \f is a ! form feed, \n is a newline, ! \r is a carriage return, \t ! is a tab, and \xxx, ! where xxx is an octal number, is a ! byte with the corresponding code. (It is your responsibility ! that the byte sequences you create are valid characters in the ! server character set encoding.) Any other character following a ! backslash is taken literally. Thus, to include a backslash in a ! string constant, write two backslashes. --- 254,271 ---- Another PostgreSQL extension is that ! C-style backslash escapes are available: \b is a ! backspace, \f is a form feed, ! \n is a newline, \r is a ! carriage return, \t is a tab. Also supported is ! \digits, where ! ddd represents an octal byte value, and ! \xhexdigits, where ! hexdigits represents a hexadecimal byte value. ! (It is your responsibility that the byte sequences you create are ! valid characters in the server character set encoding.) Any other ! character following a backslash is taken literally. Thus, to ! include a backslash in a string constant, write two backslashes. Index: src/backend/parser/scan.l =================================================================== RCS file: /cvsroot/pgsql/src/backend/parser/scan.l,v retrieving revision 1.122 diff -c -c -r1.122 scan.l *** src/backend/parser/scan.l 26 May 2005 01:24:29 -0000 1.122 --- src/backend/parser/scan.l 28 May 2005 14:03:10 -0000 *************** *** 193,200 **** xqstart {quote} xqdouble {quote}{quote} xqinside [^\\']+ ! xqescape [\\][^0-7] xqoctesc [\\][0-7]{1,3} /* $foo$ style quotes ("dollar quoting") * The quoted string starts with $foo$ where "foo" is an optional string --- 193,201 ---- xqstart {quote} xqdouble {quote}{quote} xqinside [^\\']+ ! xqescape [\\][^0-7x] xqoctesc [\\][0-7]{1,3} + xqhexesc [\\]x[0-9A-Fa-f]{1,2} /* $foo$ style quotes ("dollar quoting") * The quoted string starts with $foo$ where "foo" is an optional string *************** *** 435,440 **** --- 436,445 ---- unsigned char c = strtoul(yytext+1, NULL, 8); addlitchar(c); } + {xqhexesc} { + unsigned char c = strtoul(yytext+2, NULL, 16); + addlitchar(c); + } {quotecontinue} { /* ignore */ }