| Commit message (Collapse) | Author | Age |
... | |
|
|
|
|
|
| |
Use something like "error code %lu" for reporting GetLastError()
values on Windows. Previously, a mix of different wordings and
formats were in use.
|
| |
|
|
|
|
| |
Mostly to do with macro redefinitions or object signedness.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions should take a pg_locale_t, not a collation OID, and should
call mbstowcs_l/wcstombs_l where available. Where those functions are not
available, temporarily select the correct locale with uselocale().
This change removes the bogus assumption that all locales selectable in
a given database have the same wide-character conversion method; in
particular, the collate.linux.utf8 regression test now passes with
LC_CTYPE=C, so long as the database encoding is UTF8.
I decided to move the char2wchar/wchar2char functions out of mbutils.c and
into pg_locale.c, because they work on wchar_t not pg_wchar_t and thus
don't really belong with the mbutils.c functions. Keeping them where they
were would have required importing pg_locale_t into pg_wchar.h somehow,
which did not seem like a good plan.
|
| |
|
|
|
|
|
| |
There is not yet support in initdb to populate the pg_collation
catalog, but if that is done manually, the rest should work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous functions of assign hooks are now split between check hooks
and assign hooks, where the former can fail but the latter shouldn't.
Aside from being conceptually clearer, this approach exposes the
"canonicalized" form of the variable value to guc.c without having to do
an actual assignment. And that lets us fix the problem recently noted by
Bernd Helmle that the auto-tune patch for wal_buffers resulted in bogus
log messages about "parameter "wal_buffers" cannot be changed without
restarting the server". There may be some speed advantage too, because
this design lets hook functions avoid re-parsing variable values when
restoring a previous state after a rollback (they can store a pre-parsed
representation of the value instead). This patch also resolves a
longstanding annoyance about custom error messages from variable assign
hooks: they should modify, not appear separately from, guc.c's own message
about "invalid parameter value".
|
|
|
|
|
|
|
|
| |
pg_newlocale_from_collation does not have enough context to give an error
message that's even a little bit useful, so move the responsibility for
complaining up to its callers. Also, reword ERRCODE_INDETERMINATE_COLLATION
error messages in a less jargony, more message-style-guide-compliant
fashion.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Install just one instance of the "C" and "POSIX" collations into
pg_collation, rather than one per encoding. Make these instances exist
and do something useful even in machines without locale_t support: to wit,
it's now possible to force comparisons and case-folding functions to use C
locale in an otherwise non-C database, whether or not the platform has
support for using any additional collations.
Fix up severely broken upper/lower/initcap functions, too: the C/POSIX
fastpath now does what it is supposed to, and non-default collations are
handled correctly in single-byte database encodings.
Merge the two separate collation hashtables that were being maintained in
pg_locale.c, and be more wary of the possibility that we fail partway
through filling a cache entry.
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
|
|
|
| |
actually access it, per information from Hiroshi.
|
| |
|
|
|
|
|
|
|
|
|
| |
from lc_ctype, that could happen on Windows. We need to change lc_ctype
together with lc_monetary or lc_numeric, and convert strings in lconv
from lc_ctype encoding to the database encoding.
The bug reported by Mikko, original patch by Hiroshi Inoue,
with changes by Bruce and me.
|
| |
|
| |
|
| |
|
|
|
|
| |
provided by Andrew.
|
|
|
|
| |
per-database settings.
|
|
|
|
|
|
| |
when building on mingw.
ITAGAKI Takahiro
|
|
|
|
|
| |
For some reason it broke OpenBSD compile even when it's inside a
#ifdef WIN32 block.....
|
|
|
|
|
|
|
|
|
|
|
| |
Also, if linked against other versions than the default MSVCRT library
(for example the MSVC build which links against MSVCRT80), also update
the cache in the default MSVCRT at the same time.
This should fix the issues with setting LC_MESSAGES on the MSVC build.
Original patch from Hiroshi Inoue and Hiroshi Saito, much rewritten
by me.
|
|
|
|
|
| |
* Use correct buffer size MAX_L10N_DATA
* Use strlcpy instead of StrNCpy
|
|
|
|
|
|
|
| |
parts of a time string so it properly handles different encodings.
Original patch by Hiroshi Saito, heavily reworked by me and
ITAGAKI Takahiro.
|
| |
|
|
|
|
|
|
|
|
| |
ctype are now more like encoding, stored in new datcollate and datctype
columns in pg_database.
This is a stripped-down version of Radek Strnad's patch, with further
changes by me.
|
|
|
|
| |
Euler Taveira de Oliveira
|
| |
|
|
|
|
| |
back-stamped for this.
|
|
|
|
| |
Euler Taveira de Oliveira
|
| |
|
|
|
|
|
|
|
|
|
|
| |
for LC_MESSAGES; instead, just press forward, leaving the effective setting
at 'C'. There is not any very good reason to complain when we are going
to replace the value soon with whatever postgresql.conf says. This change
should solve the occasionally-reported problem of initdb failing with
'failed to initialize lc_messages'; the current theory is that that is
a reflection of either wrong LANG/LC_MESSAGES or completely broken locale
support.
|
| |
|
| |
|
|
|
|
|
|
| |
setup. This protects against undesired changes in locale behavior
if someone carelessly does setlocale(LC_ALL, "") (and we know who
you are, perl guys).
|
| |
|
|
|
|
|
|
|
| |
locale is C.
Backpatch to 8.0.X because some operating systems were throwing errors
for such operations, rather than ignoring the locale when it was C.
|
| |
|
|
|
|
|
|
| |
only covered the case of assigning "", and failed to recognize that
actually setlocale(LC_MESSAGES,...) does not work at all on this platform.
Magnus Hagander, some code prettification by Tom Lane.
|
| |
|
| |
|
|
|
|
| |
Per report from Magnus.
|
|
|
|
|
|
|
|
|
|
|
| |
should not be too eager to reject paths involving unknown schemas, since
it can't really tell whether the schemas exist in the target database.
(Also, when reading pg_dumpall output, it could be that the schemas
don't exist yet, but eventually will.) ALTER USER SET has a similar issue.
So, reduce the normal ERROR to a NOTICE when checking search_path values
for these commands. Supporting this requires changing the API for GUC
assign_hook functions, which causes the patch to touch a lot of places,
but the changes are conceptually trivial.
|
| |
|
|
|
|
| |
so it won't miss 'em again.
|
| |
|
|
|
|
| |
the bulk of the heavy lifting ...
|
|
|
|
|
|
| |
been bit by the fact that the locale functions return pointers to
modifiable variables. I added some comments that might help us avoid
the mistake in future.
|