mirror of
https://github.com/postgres/postgres.git
synced 2025-07-12 21:01:52 +03:00
* to_char:
- full support for IW (ISO week) and vice versa conversion for IW too (the to_char 'week' support is now complete and I hope correct). Thomas, I use for IW code from timestamp.c, for this I create separate function date2isoweek() from original 'case DTK_WEEK:' code in the timestamp_part(). I mean will better use one code for same feature in date_part() and in to_char(). The isoweek2date() is added to timestamp.c too. Right? IMHO in 7.1 will all to_char's features complete. It is cca 41 templates for date/time and cca 21 for numbers. * to_ascii: - gcc, is it correct now? :-) In the patch is documentation for to_char's IW and for to_ascii(). Karel
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
/* -----------------------------------------------------------------------
|
||||
* pg_locale.c
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/pg_locale.c,v 1.5 2000/06/29 01:19:36 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/pg_locale.c,v 1.6 2000/08/29 04:41:47 momjian Exp $
|
||||
*
|
||||
*
|
||||
* Portions Copyright (c) 1999-2000, PostgreSQL, Inc
|
||||
@ -26,6 +26,8 @@
|
||||
/* #define DEBUG_LOCALE_UTILS */
|
||||
|
||||
|
||||
static struct lconv *CurrentLocaleConv = NULL;
|
||||
|
||||
/*------
|
||||
* Return in PG_LocaleCategories current locale setting
|
||||
*------
|
||||
@ -119,7 +121,9 @@ struct lconv *
|
||||
PGLC_localeconv(void)
|
||||
{
|
||||
PG_LocaleCategories lc;
|
||||
struct lconv *lconv;
|
||||
|
||||
if (CurrentLocaleConv)
|
||||
return CurrentLocaleConv;
|
||||
|
||||
/* Save current locale setting to lc */
|
||||
PGLC_current(&lc);
|
||||
@ -128,12 +132,12 @@ PGLC_localeconv(void)
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
/* Get numeric formatting information */
|
||||
lconv = localeconv();
|
||||
CurrentLocaleConv = localeconv();
|
||||
|
||||
/* Set previous original locale */
|
||||
PGLC_setlocale(&lc);
|
||||
|
||||
return lconv;
|
||||
return CurrentLocaleConv;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user