diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-07 00:24:59 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-07 00:24:59 +0000 |
commit | 0bd61548ab8d1ac5fee63f48ee9b384502a51ad6 (patch) | |
tree | b0c63b75585d0c396e67a3acd204e226b13eae4b /src/bin/psql/command.c | |
parent | 4d46274b33db52618ccf49550213b4d5ce4a7981 (diff) | |
download | postgresql-0bd61548ab8d1ac5fee63f48ee9b384502a51ad6.tar.gz postgresql-0bd61548ab8d1ac5fee63f48ee9b384502a51ad6.zip |
Solve the 'Turkish problem' with undesirable locale behavior for case
conversion of basic ASCII letters. Remove all uses of strcasecmp and
strncasecmp in favor of new functions pg_strcasecmp and pg_strncasecmp;
remove most but not all direct uses of toupper and tolower in favor of
pg_toupper and pg_tolower. These functions use the same notions of
case folding already developed for identifier case conversion. I left
the straight locale-based folding in place for situations where we are
just manipulating user data and not trying to match it to built-in
strings --- for example, the SQL upper() function is still locale
dependent. Perhaps this will prove not to be what's wanted, but at
the moment we can initdb and pass regression tests in Turkish locale.
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r-- | src/bin/psql/command.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index d6727121b53..d880afbd276 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2003, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.115 2004/03/27 18:01:40 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.116 2004/05/07 00:24:58 tgl Exp $ */ #include "postgres_fe.h" #include "command.h" @@ -263,7 +263,7 @@ exec_command(const char *cmd, } /* \copy */ - else if (strcasecmp(cmd, "copy") == 0) + else if (pg_strcasecmp(cmd, "copy") == 0) { char *opt = psql_scan_slash_option(scan_state, OT_WHOLE_LINE, NULL, false); @@ -1321,13 +1321,13 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) { if (!value) ; - else if (strncasecmp("unaligned", value, vallen) == 0) + else if (pg_strncasecmp("unaligned", value, vallen) == 0) popt->topt.format = PRINT_UNALIGNED; - else if (strncasecmp("aligned", value, vallen) == 0) + else if (pg_strncasecmp("aligned", value, vallen) == 0) popt->topt.format = PRINT_ALIGNED; - else if (strncasecmp("html", value, vallen) == 0) + else if (pg_strncasecmp("html", value, vallen) == 0) popt->topt.format = PRINT_HTML; - else if (strncasecmp("latex", value, vallen) == 0) + else if (pg_strncasecmp("latex", value, vallen) == 0) popt->topt.format = PRINT_LATEX; else { @@ -1452,7 +1452,7 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) /* toggle use of pager */ else if (strcmp(param, "pager") == 0) { - if (value && strcasecmp(value, "always") == 0) + if (value && pg_strcasecmp(value, "always") == 0) popt->topt.pager = 2; else if (popt->topt.pager == 1) popt->topt.pager = 0; |