1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

Implement a solution to the 'Turkish locale downcases I incorrectly'

problem, per previous discussion.  Make some additional changes to
centralize the knowledge of just how identifier downcasing is done,
in hopes of simplifying any future tweaking in this area.
This commit is contained in:
Tom Lane
2004-02-21 00:34:53 +00:00
parent 1d567aee07
commit 59f9a0b9df
10 changed files with 158 additions and 125 deletions

View File

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/define.c,v 1.85 2003/11/29 19:51:47 pgsql Exp $
* $PostgreSQL: pgsql/src/backend/commands/define.c,v 1.86 2004/02/21 00:34:52 tgl Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
@ -38,24 +38,19 @@
#include "catalog/namespace.h"
#include "commands/defrem.h"
#include "parser/parse_type.h"
#include "parser/scansup.h"
#include "utils/int8.h"
/*
* Translate the input language name to lower case.
* Translate the input language name to lower case, and truncate if needed.
*
* Output buffer must be NAMEDATALEN long.
* Returns a palloc'd string
*/
void
case_translate_language_name(const char *input, char *output)
char *
case_translate_language_name(const char *input)
{
int i;
MemSet(output, 0, NAMEDATALEN); /* ensure result Name is
* zero-filled */
for (i = 0; i < NAMEDATALEN - 1 && input[i]; ++i)
output[i] = tolower((unsigned char) input[i]);
return downcase_truncate_identifier(input, strlen(input), false);
}