diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2011-02-08 23:04:18 +0200 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2011-02-08 23:04:18 +0200 |
commit | 414c5a2ea65cbd38d79ffdf9b1fde7cc75c134e0 (patch) | |
tree | 016efd0c7108f659ea4f3c52ea54d78e1e5449e1 /src/include/utils/pg_locale.h | |
parent | 1703f0e8da2e8e3eccb6e12879c011ba106f8a62 (diff) | |
download | postgresql-414c5a2ea65cbd38d79ffdf9b1fde7cc75c134e0.tar.gz postgresql-414c5a2ea65cbd38d79ffdf9b1fde7cc75c134e0.zip |
Per-column collation support
This adds collation support for columns and domains, a COLLATE clause
to override it per expression, and B-tree index support.
Peter Eisentraut
reviewed by Pavel Stehule, Itagaki Takahiro, Robert Haas, Noah Misch
Diffstat (limited to 'src/include/utils/pg_locale.h')
-rw-r--r-- | src/include/utils/pg_locale.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/include/utils/pg_locale.h b/src/include/utils/pg_locale.h index d56bf38d2d1..4c72fd0dc6c 100644 --- a/src/include/utils/pg_locale.h +++ b/src/include/utils/pg_locale.h @@ -13,6 +13,9 @@ #define _PG_LOCALE_ #include <locale.h> +#ifdef LOCALE_T_IN_XLOCALE +#include <xlocale.h> +#endif #include "utils/guc.h" @@ -42,8 +45,8 @@ extern const char *locale_time_assign(const char *value, extern bool check_locale(int category, const char *locale); extern char *pg_perm_setlocale(int category, const char *locale); -extern bool lc_collate_is_c(void); -extern bool lc_ctype_is_c(void); +extern bool lc_collate_is_c(Oid collation); +extern bool lc_ctype_is_c(Oid collation); /* * Return the POSIX lconv struct (contains number/money formatting @@ -53,4 +56,20 @@ extern struct lconv *PGLC_localeconv(void); extern void cache_locale_time(void); + +/* + * We define our own wrapper around locale_t so we can keep the same + * function signatures for all builds, while not having to create a + * fake version of the standard type locale_t in the global namespace. + * The fake version of pg_locale_t can be checked for truth; that's + * about all it will be needed for. + */ +#ifdef HAVE_LOCALE_T +typedef locale_t pg_locale_t; +#else +typedef int pg_locale_t; +#endif + +extern pg_locale_t pg_newlocale_from_collation(Oid collid); + #endif /* _PG_LOCALE_ */ |