mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
I have committed many support files for CREATE CONVERSION. Default
conversion procs and conversions are added in initdb. Currently supported conversions are: UTF-8(UNICODE) <--> SQL_ASCII, ISO-8859-1 to 16, EUC_JP, EUC_KR, EUC_CN, EUC_TW, SJIS, BIG5, GBK, GB18030, UHC, JOHAB, TCVN EUC_JP <--> SJIS EUC_TW <--> BIG5 MULE_INTERNAL <--> EUC_JP, SJIS, EUC_TW, BIG5 Note that initial contents of pg_conversion system catalog are created in the initdb process. So doing initdb required is ideal, it's possible to add them to your databases by hand, however. To accomplish this: psql -f your_postgresql_install_path/share/conversion_create.sql your_database So I did not bump up the version in cataversion.h. TODO: Add more conversion procs Add [CASCADE|RESTRICT] to DROP CONVERSION Add tuples to pg_depend Add regression tests Write docs Add SQL99 CONVERT command? -- Tatsuo Ishii
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright 2000 by PostgreSQL Global Development Group
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.73 2002/07/15 01:56:25 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.74 2002/07/18 02:02:30 ishii Exp $
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
#include "command.h"
|
||||
@ -38,14 +38,7 @@
|
||||
#include "print.h"
|
||||
#include "settings.h"
|
||||
#include "variables.h"
|
||||
|
||||
#ifdef MULTIBYTE
|
||||
#include "mb/pg_wchar.h"
|
||||
#else
|
||||
/* Grand unified hard-coded badness */
|
||||
#define pg_encoding_to_char(x) "SQL_ASCII"
|
||||
#endif
|
||||
|
||||
|
||||
/* functions for use in this file */
|
||||
|
||||
@ -457,10 +450,9 @@ exec_command(const char *cmd,
|
||||
puts(pg_encoding_to_char(pset.encoding));
|
||||
else
|
||||
{
|
||||
#ifdef MULTIBYTE
|
||||
/* set encoding */
|
||||
if (PQsetClientEncoding(pset.db, encoding) == -1)
|
||||
psql_error("%s: invalid encoding name\n", encoding);
|
||||
psql_error("%s: invalid encoding name or conversion proc not found\n", encoding);
|
||||
|
||||
else
|
||||
{
|
||||
@ -468,9 +460,6 @@ exec_command(const char *cmd,
|
||||
pset.encoding = PQclientEncoding(pset.db);
|
||||
SetVariable(pset.vars, "ENCODING", pg_encoding_to_char(pset.encoding));
|
||||
}
|
||||
#else
|
||||
psql_error("\\%s: multibyte support is not enabled\n", cmd);
|
||||
#endif
|
||||
free(encoding);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user