Commit ab9b6c45 authored by Tatsuo Ishii's avatar Tatsuo Ishii

Add conver/convert2 functions. They are similar to the SQL99's convert.

parent 872cd63d
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.75 2001/08/06 18:17:42 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.76 2001/08/15 07:07:40 ishii Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -209,6 +209,19 @@ PG_char_to_encoding(PG_FUNCTION_ARGS)
PG_RETURN_INT32(0);
}
Datum
pg_convert(PG_FUNCTION_ARGS)
{
elog(ERROR, "convert is not supported. To use convert, you need to enable multibyte capability");
return DirectFunctionCall1(textin, CStringGetDatum(""));
}
Datum
pg_convert2(PG_FUNCTION_ARGS)
{
elog(ERROR, "convert is not supported. To use convert, you need to enable multibyte capability");
return DirectFunctionCall1(textin, CStringGetDatum(""));
}
#endif
/* ----------------------------------------------------------------
......
This diff is collapsed.
......@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_proc.h,v 1.204 2001/08/14 22:21:58 tgl Exp $
* $Id: pg_proc.h,v 1.205 2001/08/15 07:07:40 ishii Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
......@@ -2137,7 +2137,13 @@ DESCR("return portion of string");
DATA(insert OID = 1039 ( getdatabaseencoding PGUID 12 f t f t 0 f 19 "0" 100 0 0 100 getdatabaseencoding - ));
DESCR("encoding name of current database");
DATA(insert OID = 1295 ( pg_char_to_encoding PGUID 12 f t f t 1 f 23 "19" 100 0 0 100 PG_char_to_encoding - ));
DATA(insert OID = 1717 ( convert PGUID 12 f t f t 2 f 25 "25 19" 100 0 0 100 pg_convert - ));
DESCR("convert string with specified destination encoding name");
DATA(insert OID = 1813 ( convert PGUID 12 f t f t 3 f 25 "25 19 19" 100 0 0 100 pg_convert2 - ));
DESCR("convert string with specified encoding names");
DATA(insert OID = 1264 ( pg_char_to_encoding PGUID 12 f t f t 1 f 23 "19" 100 0 0 100 PG_char_to_encoding - ));
DESCR("convert encoding name to encoding id");
DATA(insert OID = 1597 ( pg_encoding_to_char PGUID 12 f t f t 1 f 19 "23" 100 0 0 100 PG_encoding_to_char - ));
......
/* $Id: pg_wchar.h,v 1.27 2001/07/15 11:07:37 ishii Exp $ */
/* $Id: pg_wchar.h,v 1.28 2001/08/15 07:07:40 ishii Exp $ */
#ifndef PG_WCHAR_H
#define PG_WCHAR_H
......@@ -145,6 +145,8 @@ extern unsigned char *pg_server_to_client(unsigned char *, int);
extern int pg_valid_client_encoding(const char *);
extern pg_encoding_conv_tbl *pg_get_enc_ent(int);
extern int pg_utf_mblen(const unsigned char *);
extern int pg_find_encoding_converters(int, int, void (**)(), void (**)());
extern unsigned char *pg_do_encoding_conversion(unsigned char *, int, void (*)(), void (*)());
/* internally-used versions of functions. The PG_xxx forms of these
* functions have fmgr-compatible interfaves.
......
......@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: builtins.h,v 1.161 2001/08/14 22:21:59 tgl Exp $
* $Id: builtins.h,v 1.162 2001/08/15 07:07:40 ishii Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -581,6 +581,8 @@ extern Datum RI_FKey_setdefault_upd(PG_FUNCTION_ARGS);
extern Datum getdatabaseencoding(PG_FUNCTION_ARGS);
extern Datum PG_encoding_to_char(PG_FUNCTION_ARGS);
extern Datum PG_char_to_encoding(PG_FUNCTION_ARGS);
extern Datum pg_convert(PG_FUNCTION_ARGS);
extern Datum pg_convert2(PG_FUNCTION_ARGS);
/* format_type.c */
extern Datum format_type(PG_FUNCTION_ARGS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment