aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/pg_locale.c
Commit message (Collapse)AuthorAge
...
* Use consistent format for reporting GetLastError()Peter Eisentraut2011-08-23
| | | | | | Use something like "error code %lu" for reporting GetLastError() values on Windows. Previously, a mix of different wordings and formats were in use.
* Pgindent run before 9.1 beta2.Bruce Momjian2011-06-09
|
* Assorted minor changes to silence Windows compiler warnings.Andrew Dunstan2011-04-25
| | | | Mostly to do with macro redefinitions or object signedness.
* Fix char2wchar/wchar2char to support collations properly.Tom Lane2011-04-23
| | | | | | | | | | | | | | | | | 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.
* pgindent run before PG 9.1 beta 1.Bruce Momjian2011-04-10
|
* Add collation support on Windows (MSVC build)Peter Eisentraut2011-04-10
| | | | | There is not yet support in initdb to populate the pg_collation catalog, but if that is done manually, the rest should work.
* Revise the API for GUC variable assign hooks.Tom Lane2011-04-07
| | | | | | | | | | | | | | | | | 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".
* Improve reporting of run-time-detected indeterminate-collation errors.Tom Lane2011-03-22
| | | | | | | | 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.
* Fix up handling of C/POSIX collations.Tom Lane2011-03-20
| | | | | | | | | | | | | | | | | 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.
* Per-column collation supportPeter Eisentraut2011-02-08
| | | | | | | | 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
* Stamp copyrights for year 2011.Bruce Momjian2011-01-01
|
* Remove cvs keywords from all files.Magnus Hagander2010-09-20
|
* pgindent run for 9.0, second runBruce Momjian2010-07-06
|
* Add comments about why we set LC_CTYPE in WIN32 for time when we don'tBruce Momjian2010-04-26
| | | | actually access it, per information from Hiroshi.
* Add C comments for recent to_char('L') fix for Win32.Bruce Momjian2010-04-24
|
* Fix encoding issue when lc_monetary or lc_numeric are different encodingItagaki Takahiro2010-04-22
| | | | | | | | | 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.
* Back out unintended change to pg_locale.c.Bruce Momjian2010-02-27
|
* Document ATAPI FLUSH CACHE EXT.Bruce Momjian2010-02-27
|
* Update copyright for the year 2010.Bruce Momjian2010-01-02
|
* 8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef listBruce Momjian2009-06-11
| | | | provided by Andrew.
* Update comment to reflect that LC_COLLATE and LC_CTYPE are nowHeikki Linnakangas2009-04-01
| | | | per-database settings.
* Silence compiler warnings in new win32 locale codeMagnus Hagander2009-01-27
| | | | | | when building on mingw. ITAGAKI Takahiro
* Remove stray ' character at end of line.Magnus Hagander2009-01-21
| | | | | For some reason it broke OpenBSD compile even when it's inside a #ifdef WIN32 block.....
* Make win32 builds always do SetEnvironmentVariable() when doing putenv().Magnus Hagander2009-01-21
| | | | | | | | | | | 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.
* Code review of strftime patch, per comments from Tom:Magnus Hagander2009-01-09
| | | | | * Use correct buffer size MAX_L10N_DATA * Use strlcpy instead of StrNCpy
* Fix strftime usage on Win32 when trying to fetch the locale-awareMagnus Hagander2009-01-09
| | | | | | | parts of a time string so it properly handles different encodings. Original patch by Hiroshi Saito, heavily reworked by me and ITAGAKI Takahiro.
* Update copyright for 2009.Bruce Momjian2009-01-01
|
* Make LC_COLLATE and LC_CTYPE database-level settings. Collation andHeikki Linnakangas2008-09-23
| | | | | | | | 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.
* Make to_char()'s localized month/day names depend on LC_TIME, not LC_MESSAGES.Tom Lane2008-05-19
| | | | Euler Taveira de Oliveira
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-01
|
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-05
| | | | back-stamped for this.
* Fix to_char() locale handling to honor LC_TIME, not LC_MESSAGES.Bruce Momjian2006-11-24
| | | | Euler Taveira de Oliveira
* pgindent run for 8.2.Bruce Momjian2006-10-04
|
* Don't choke during startup if the environment offers an invalid valueTom Lane2006-06-03
| | | | | | | | | | 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.
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-05
|
* Don't assume that LC_MESSAGES is always available on WIN32. Per Magnus.Tom Lane2006-01-02
|
* Arrange to set the LC_XXX environment variables to match our localeTom Lane2005-12-28
| | | | | | setup. This protects against undesired changes in locale behavior if someone carelessly does setlocale(LC_ALL, "") (and we know who you are, perl guys).
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* Prevent locale-aware handling of upper, lower, and initcap when theBruce Momjian2005-03-16
| | | | | | | 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.
* Update copyrights that were missed.Bruce Momjian2005-01-01
|
* Make locale_messages_assign() really work on Windows; the prior hackTom Lane2004-10-17
| | | | | | 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.
* Pgindent run for 8.0.Bruce Momjian2004-08-29
|
* Update copyright to 2004.Bruce Momjian2004-08-29
|
* On WIN32, don't choke when setlocale(LC_MESSAGES, "") returns NULL.Tom Lane2004-05-27
| | | | Per report from Magnus.
* Repair problem identified by Olivier Prenant: ALTER DATABASE SET search_pathTom Lane2004-01-19
| | | | | | | | | | | 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.
* $Header: -> $PostgreSQL Changes ...PostgreSQL Daemon2003-11-29
|
* Fix some copyright notices that weren't updated. Improve copyright toolTom Lane2003-08-04
| | | | so it won't miss 'em again.
* pgindent run.Bruce Momjian2003-08-04
|
* Error message editing in utils/adt. Again thanks to Joe Conway for doingTom Lane2003-07-27
| | | | the bulk of the heavy lifting ...
* Fix breakage that had crept into setlocale() usage: once again we'veTom Lane2002-10-18
| | | | | | 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.