mirror of
https://github.com/postgres/postgres.git
synced 2025-04-25 21:42:33 +03:00
Add builtin functions:
pg_char_to_encoding() pg_encoding_to_char()
This commit is contained in:
parent
d58fa7611b
commit
5eb1d0deb1
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.39 2000/01/13 18:26:11 petere Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.40 2000/01/18 05:10:29 ishii Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -67,12 +67,24 @@ SetDatabaseName(const char *name)
|
|||||||
|
|
||||||
#ifndef MULTIBYTE
|
#ifndef MULTIBYTE
|
||||||
/* even if MULTIBYTE is not enabled, this function is neccesary
|
/* even if MULTIBYTE is not enabled, this function is neccesary
|
||||||
* since pg_proc.h has an entry for it.
|
* since pg_proc.h has entries for them.
|
||||||
*/
|
*/
|
||||||
const char *
|
const char *
|
||||||
getdatabaseencoding()
|
getdatabaseencoding()
|
||||||
{
|
{
|
||||||
elog(ERROR, "MultiByte strings (MB) must be enabled to use this function");
|
elog(ERROR, "MultiByte support must be enabled to use this function");
|
||||||
|
return ("");
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *pg_encoding_to_char(int encoding)
|
||||||
|
{
|
||||||
|
elog(ERROR, "MultiByte support must be enabled to use this function");
|
||||||
|
return ("");
|
||||||
|
}
|
||||||
|
|
||||||
|
int pg_char_to_encoding(const char *encoding_string)
|
||||||
|
{
|
||||||
|
elog(ERROR, "MultiByte support must be enabled to use this function");
|
||||||
return ("");
|
return ("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: catversion.h,v 1.7 2000/01/14 00:53:50 tgl Exp $
|
* $Id: catversion.h,v 1.8 2000/01/18 05:08:29 ishii Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -52,6 +52,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* yyyymmddN */
|
/* yyyymmddN */
|
||||||
#define CATALOG_VERSION_NO 200001131
|
#define CATALOG_VERSION_NO 200001171
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: pg_proc.h,v 1.113 2000/01/17 00:40:51 tgl Exp $
|
* $Id: pg_proc.h,v 1.114 2000/01/18 05:08:29 ishii Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* The script catalog/genbki.sh reads this file and generates .bki
|
* The script catalog/genbki.sh reads this file and generates .bki
|
||||||
@ -2110,6 +2110,13 @@ DESCR("sequence set value");
|
|||||||
|
|
||||||
/* for multi-byte support */
|
/* for multi-byte support */
|
||||||
DATA(insert OID = 1039 ( getdatabaseencoding PGUID 11 f t f 0 f 19 "0" 100 0 0 100 getdatabaseencoding - ));
|
DATA(insert OID = 1039 ( getdatabaseencoding PGUID 11 f t f 0 f 19 "0" 100 0 0 100 getdatabaseencoding - ));
|
||||||
|
DESCR("encoding name of current database");
|
||||||
|
|
||||||
|
DATA(insert OID = 1295 ( pg_char_to_encoding PGUID 11 f t f 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 11 f t f 1 f 19 "23" 100 0 0 100 pg_encoding_to_char - ));
|
||||||
|
DESCR("convert encoding id to encoding name");
|
||||||
|
|
||||||
/* System-view support functions */
|
/* System-view support functions */
|
||||||
DATA(insert OID = 1640 ( pg_get_ruledef PGUID 11 f t f 1 f 25 "19" 100 0 0 100 pg_get_ruledef - ));
|
DATA(insert OID = 1640 ( pg_get_ruledef PGUID 11 f t f 1 f 25 "19" 100 0 0 100 pg_get_ruledef - ));
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: pg_wchar.h,v 1.12 2000/01/15 18:30:35 petere Exp $ */
|
/* $Id: pg_wchar.h,v 1.13 2000/01/18 05:08:31 ishii Exp $ */
|
||||||
|
|
||||||
#ifndef PG_WCHAR_H
|
#ifndef PG_WCHAR_H
|
||||||
#define PG_WCHAR_H
|
#define PG_WCHAR_H
|
||||||
@ -121,8 +121,13 @@ extern int pg_get_client_encoding(void);
|
|||||||
extern unsigned char *pg_client_to_server(unsigned char *, int);
|
extern unsigned char *pg_client_to_server(unsigned char *, int);
|
||||||
extern unsigned char *pg_server_to_client(unsigned char *, int);
|
extern unsigned char *pg_server_to_client(unsigned char *, int);
|
||||||
extern int pg_valid_client_encoding(const char *);
|
extern int pg_valid_client_encoding(const char *);
|
||||||
|
|
||||||
|
/* moved to miscadmin.h
|
||||||
|
* pg_proc.h now have them.
|
||||||
extern const char *pg_encoding_to_char(int);
|
extern const char *pg_encoding_to_char(int);
|
||||||
extern int pg_char_to_encoding(const char *);
|
extern int pg_char_to_encoding(const char *);
|
||||||
|
*/
|
||||||
|
|
||||||
extern int GetDatabaseEncoding(void);
|
extern int GetDatabaseEncoding(void);
|
||||||
extern void SetDatabaseEncoding(int);
|
extern void SetDatabaseEncoding(int);
|
||||||
extern void SetTemplateEncoding(int);
|
extern void SetTemplateEncoding(int);
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: miscadmin.h,v 1.47 2000/01/13 18:26:15 petere Exp $
|
* $Id: miscadmin.h,v 1.48 2000/01/18 05:08:29 ishii Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* some of the information in this file will be moved to
|
* some of the information in this file will be moved to
|
||||||
@ -119,10 +119,12 @@ extern char *ExpandDatabasePath(const char *path);
|
|||||||
extern void SetDatabaseName(const char *name);
|
extern void SetDatabaseName(const char *name);
|
||||||
extern void SetDatabasePath(const char *path);
|
extern void SetDatabasePath(const char *path);
|
||||||
|
|
||||||
/* even if MB is not enabled, this function is neccesary
|
/* even if MULTIBYTE is not enabled, this function is neccesary
|
||||||
* since pg_proc.h does have.
|
* since pg_proc.h does have.
|
||||||
*/
|
*/
|
||||||
extern const char *getdatabaseencoding(void);
|
extern const char *getdatabaseencoding(void);
|
||||||
|
extern const char *pg_encoding_to_char(int);
|
||||||
|
extern int pg_char_to_encoding(const char *);
|
||||||
|
|
||||||
extern char *getpgusername(void);
|
extern char *getpgusername(void);
|
||||||
extern void SetPgUserName(void);
|
extern void SetPgUserName(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user