postgresql/src
Tom Lane a6525588b7 Allow Unicode escapes in any server encoding, not only UTF-8.
SQL includes provisions for numeric Unicode escapes in string
literals and identifiers.  Previously we only accepted those
if they represented ASCII characters or the server encoding
was UTF-8, making the conversion to internal form trivial.
This patch adjusts things so that we'll call the appropriate
encoding conversion function in less-trivial cases, allowing
the escape sequence to be accepted so long as it corresponds
to some character available in the server encoding.

This also applies to processing of Unicode escapes in JSONB.
However, the old restriction still applies to client-side
JSON processing, since that hasn't got access to the server's
encoding conversion infrastructure.

This patch includes some lexer infrastructure that simplifies
throwing errors with error cursors pointing into the middle of
a string (or other complex token).  For the moment I only used
it for errors relating to Unicode escapes, but we might later
expand the usage to some other cases.

Patch by me, reviewed by John Naylor.

Discussion: https://postgr.es/m/2393.1578958316@sss.pgh.pa.us
2020-03-06 14:17:43 -05:00
..
backend Allow Unicode escapes in any server encoding, not only UTF-8. 2020-03-06 14:17:43 -05:00
bin Allow ALTER TYPE to change some properties of a base type. 2020-03-06 12:19:29 -05:00
common Allow Unicode escapes in any server encoding, not only UTF-8. 2020-03-06 14:17:43 -05:00
fe_utils Fix bug in pg_basebackup -F plain -R. 2020-02-12 09:08:22 +09:00
include Allow Unicode escapes in any server encoding, not only UTF-8. 2020-03-06 14:17:43 -05:00
interfaces Fix issues around .pgpass file. 2020-03-05 13:00:38 +09:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Remove the "opaque" pseudo-type and associated compatibility hacks. 2020-03-05 15:48:56 -05:00
port Move pg_upgrade's Windows link() implementation to AC_REPLACE_FUNCS 2020-03-04 08:22:54 +01:00
template Fix compiler warning for ppoll() on Cygwin 2019-12-22 23:20:00 +01:00
test Allow Unicode escapes in any server encoding, not only UTF-8. 2020-03-06 14:17:43 -05:00
timezone Require stdint.h 2020-02-21 09:20:32 +01:00
tools Move pg_upgrade's Windows link() implementation to AC_REPLACE_FUNCS 2020-03-04 08:22:54 +01:00
tutorial Update copyrights for 2020 2020-01-01 12:21:45 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00