aboutsummaryrefslogtreecommitdiff
path: root/contrib/jsonb_plpython/sql/jsonb_plpython.sql
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2024-10-07 12:13:02 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2024-10-07 12:13:02 -0400
commitef0938f7bdd0838857da38b9a660191ec8411696 (patch)
treed12e059f4625cb6ffc717886ff561a60af5b2bda /contrib/jsonb_plpython/sql/jsonb_plpython.sql
parent8275325a06ed91c053e046422a193dc6d56a70c5 (diff)
downloadpostgresql-ef0938f7bdd0838857da38b9a660191ec8411696.tar.gz
postgresql-ef0938f7bdd0838857da38b9a660191ec8411696.zip
Invent "MatchAnyN" option for tab-complete.c's Matches/MatchesCS.
This argument matches any number (including zero) of previous words. Use it to replace the common coding pattern if (HeadMatches("A", "B") && TailMatches("X", "Y")) with if (Matches("A", "B", MatchAnyN, "X", "Y")) In itself this feature doesn't do much except (arguably) make the code slightly shorter and more readable. However, it reduces the number of complex if-condition patterns that have to be dealt with in the next commits in this series. While here, restructure the *Matches implementation functions so that the actual work is done in functions that take a char ** array of pattern strings, and the versions taking variadic arguments are thin wrappers around the array ones. This simplifies the new Matches logic considerably. At the end of this patch series, the array functions will be the only ones that are material to performance, so having the variadic ones be wrappers makes sense. Discussion: https://postgr.es/m/2208466.1720729502@sss.pgh.pa.us
Diffstat (limited to 'contrib/jsonb_plpython/sql/jsonb_plpython.sql')
0 files changed, 0 insertions, 0 deletions