postgresql/src/include
Tom Lane 2a0af7fe46 Allow complemented character class escapes within regex brackets.
The complement-class escapes \D, \S, \W are now allowed within
bracket expressions.  There is no semantic difficulty with doing
that, but the rather hokey macro-expansion-based implementation
previously used here couldn't cope.

Also, invent "word" as an allowed character class name, thus "\w"
is now equivalent to "[[:word:]]" outside brackets, or "[:word:]"
within brackets.  POSIX allows such implementation-specific
extensions, and the same name is used in e.g. bash.

One surprising compatibility issue this raises is that constructs
such as "[\w-_]" are now disallowed, as our documentation has always
said they should be: character classes can't be endpoints of a range.
Previously, because \w was just a macro for "[:alnum:]_", such a
construct was read as "[[:alnum:]_-_]", so it was accepted so long as
the character after "-" was numerically greater than or equal to "_".

Some implementation cleanup along the way:

* Remove the lexnest() hack, and in consequence clean up wordchrs()
to not interact with the lexer.

* Fix colorcomplement() to not be O(N^2) in the number of colors
involved.

* Get rid of useless-as-far-as-I-can-see calls of element()
on single-character character element names in brackpart().
element() always maps these to the character itself, and things
would be quite broken if it didn't --- should "[a]" match something
different than "a" does?  Besides, the shortcut path in brackpart()
wasn't doing this anyway, making it even more inconsistent.

Discussion: https://postgr.es/m/2845172.1613674385@sss.pgh.pa.us
Discussion: https://postgr.es/m/3220564.1613859619@sss.pgh.pa.us
2021-02-25 13:00:40 -05:00
..
access Use full 64-bit XIDs in deleted nbtree pages. 2021-02-24 18:41:34 -08:00
bootstrap Update copyright for 2021 2021-01-02 13:06:25 -05:00
catalog pg_collation_actual_version() -> pg_collation_current_version(). 2021-02-22 23:32:16 +13:00
commands Allow multiple xacts during table sync in logical replication. 2021-02-12 07:41:51 +05:30
common Add result size as argument of pg_cryptohash_final() for overflow checks 2021-02-15 10:18:34 +09:00
datatype Update copyright for 2021 2021-01-02 13:06:25 -05:00
executor Fix permission checks on constraint violation errors on partitions. 2021-02-08 11:01:51 +02:00
fe_utils Generalize parallel slot result handling. 2021-02-05 16:08:45 -05:00
foreign Implement support for bulk inserts in postgres_fdw 2021-01-20 23:57:27 +01:00
jit Update copyright for 2021 2021-01-02 13:06:25 -05:00
lib Update copyright for 2021 2021-01-02 13:06:25 -05:00
libpq Allow specifying CRL directory 2021-02-18 07:59:10 +01:00
mb Add mbverifystr() functions specific to each encoding. 2021-01-28 14:40:07 +02:00
nodes Make ExecGetInsertedCols() and friends more robust and improve comments. 2021-02-15 09:28:08 +02:00
optimizer Remove [Merge]AppendPath.partitioned_rels. 2021-02-01 14:43:54 -05:00
parser Remove no-longer-used RTE argument of markVarForSelectPriv(). 2021-02-11 11:23:25 -05:00
partitioning Remove [Merge]AppendPath.partitioned_rels. 2021-02-01 14:43:54 -05:00
port Default to wal_sync_method=fdatasync on FreeBSD. 2021-02-15 16:04:59 +13:00
portability Update copyright for 2021 2021-01-02 13:06:25 -05:00
postmaster Update copyright for 2021 2021-01-02 13:06:25 -05:00
regex Allow complemented character class escapes within regex brackets. 2021-02-25 13:00:40 -05:00
replication Fix the warnings introduced in commit ce0fdbfe97. 2021-02-15 07:28:02 +05:30
rewrite SEARCH and CYCLE clauses 2021-02-01 14:32:51 +01:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Update copyright for 2021 2021-01-02 13:06:25 -05:00
storage Use full 64-bit XIDs in deleted nbtree pages. 2021-02-24 18:41:34 -08:00
tcop Update copyright for 2021 2021-01-02 13:06:25 -05:00
tsearch Convert tsginidx.c's GIN indexing logic to fully ternary operation. 2021-02-16 12:07:14 -05:00
utils Hide internal error for pg_collation_actual_version(<bad OID>). 2021-02-22 23:01:20 +13:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h Tweak compiler version cutoff for no_sanitize("alignment") support. 2021-02-12 17:33:14 -05:00
fmgr.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
funcapi.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
getaddrinfo.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
getopt_long.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
Makefile Build in some knowledge about foreign-key relationships in the catalogs. 2021-02-02 17:11:55 -05:00
miscadmin.h Add idle_session_timeout. 2021-01-06 18:28:52 -05:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Fix some typos, grammar and style in docs and comments 2021-02-24 16:13:17 +09:00
pg_config.h.in Fix inconsistent configure data for --with-ssl 2021-02-20 10:17:10 +09:00
pg_getopt.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_trace.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pgstat.h Bump PGSTAT_FILE_FORMAT_ID 2021-01-18 17:51:49 +01:00
pgtar.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pgtime.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
port.h Provide pg_preadv() and pg_pwritev(). 2021-01-11 15:24:38 +13:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
postgres.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
rusagestub.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
windowapi.h Update copyright for 2021 2021-01-02 13:06:25 -05:00