diff options
| author | Peter Eisentraut | 2022-09-16 12:51:47 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2022-09-16 12:53:12 +0000 |
| commit | 5ac51c8c9e4434140f4ba45b7bdb38896b48cc64 (patch) | |
| tree | 1b55802b0fad234d98c2e6ea0488883cd467875f /src/include | |
| parent | 1e08576691bf1a25c0e28745e5e800c44f2a1c76 (diff) | |
Adjust assorted hint messages that list all valid options.
Instead of listing all valid options, we now try to provide one
that looks similar. Since this may be useful elsewhere, this
change introduces a new set of functions that can be reused for
similar purposes.
Author: Nathan Bossart <nathandbossart@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/b1f9f399-3a1a-b554-283f-4ae7f34608e2@enterprisedb.com
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/utils/varlena.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/include/utils/varlena.h b/src/include/utils/varlena.h index c45208a2048..a4a0566622c 100644 --- a/src/include/utils/varlena.h +++ b/src/include/utils/varlena.h @@ -38,4 +38,16 @@ extern text *replace_text_regexp(text *src_text, text *pattern_text, int cflags, Oid collation, int search_start, int n); +typedef struct ClosestMatchState +{ + const char *source; + int min_d; + int max_d; + const char *match; +} ClosestMatchState; + +extern void initClosestMatch(ClosestMatchState *state, const char *source, int max_d); +extern void updateClosestMatch(ClosestMatchState *state, const char *candidate); +extern const char *getClosestMatch(ClosestMatchState *state); + #endif |
