mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Allow hyphens in ltree labels
Also increase the allowed length of labels to 1000 characters Garen Torikian Discussion: https://postgr.es/m/CAGXsc+-mNg9Gc0rp-ER0sv+zkZSZp2wE9-LX6XcoWSLVz22tZA@mail.gmail.com
This commit is contained in:
@@ -12,10 +12,10 @@
|
||||
|
||||
/*
|
||||
* We want the maximum length of a label to be encoding-independent, so
|
||||
* set it somewhat arbitrarily at 255 characters (not bytes), while using
|
||||
* set it somewhat arbitrarily at 1000 characters (not bytes), while using
|
||||
* uint16 fields to hold the byte length.
|
||||
*/
|
||||
#define LTREE_LABEL_MAX_CHARS 255
|
||||
#define LTREE_LABEL_MAX_CHARS 1000
|
||||
|
||||
/*
|
||||
* LOWER_NODE used to be defined in the Makefile via the compile flags.
|
||||
@@ -126,7 +126,8 @@ typedef struct
|
||||
|
||||
#define LQUERY_HASNOT 0x01
|
||||
|
||||
#define ISALNUM(x) ( t_isalnum(x) || t_iseq(x, '_') )
|
||||
/* valid label chars are alphanumerics, underscores and hyphens */
|
||||
#define ISLABEL(x) ( t_isalnum(x) || t_iseq(x, '_') || t_iseq(x, '-') )
|
||||
|
||||
/* full text query */
|
||||
|
||||
|
Reference in New Issue
Block a user