Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5eb1d0d

Browse files
committed
Add builtin functions:
pg_char_to_encoding()pg_encoding_to_char()
1 parentd58fa76 commit5eb1d0d

File tree

5 files changed

+35
-9
lines changed

5 files changed

+35
-9
lines changed

‎src/backend/utils/init/miscinit.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.39 2000/01/13 18:26:11 petere Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.40 2000/01/18 05:10:29 ishii Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -67,12 +67,24 @@ SetDatabaseName(const char *name)
6767

6868
#ifndefMULTIBYTE
6969
/* even if MULTIBYTE is not enabled, this function is neccesary
70-
* since pg_proc.h hasan entryforit.
70+
* since pg_proc.h hasentriesforthem.
7171
*/
7272
constchar*
7373
getdatabaseencoding()
7474
{
75-
elog(ERROR,"MultiByte strings (MB) must be enabled to use this function");
75+
elog(ERROR,"MultiByte support must be enabled to use this function");
76+
return ("");
77+
}
78+
79+
constchar*pg_encoding_to_char(intencoding)
80+
{
81+
elog(ERROR,"MultiByte support must be enabled to use this function");
82+
return ("");
83+
}
84+
85+
intpg_char_to_encoding(constchar*encoding_string)
86+
{
87+
elog(ERROR,"MultiByte support must be enabled to use this function");
7688
return ("");
7789
}
7890

‎src/include/catalog/catversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*
3737
* Copyright (c) 1994, Regents of the University of California
3838
*
39-
* $Id: catversion.h,v 1.7 2000/01/14 00:53:50 tgl Exp $
39+
* $Id: catversion.h,v 1.8 2000/01/18 05:08:29 ishii Exp $
4040
*
4141
*-------------------------------------------------------------------------
4242
*/
@@ -52,6 +52,6 @@
5252
*/
5353

5454
/* yyyymmddN */
55-
#defineCATALOG_VERSION_NO200001131
55+
#defineCATALOG_VERSION_NO200001171
5656

5757
#endif

‎src/include/catalog/pg_proc.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: pg_proc.h,v 1.113 2000/01/17 00:40:51 tgl Exp $
9+
* $Id: pg_proc.h,v 1.114 2000/01/18 05:08:29 ishii Exp $
1010
*
1111
* NOTES
1212
* The script catalog/genbki.sh reads this file and generates .bki
@@ -2110,6 +2110,13 @@ DESCR("sequence set value");
21102110

21112111
/* for multi-byte support */
21122112
DATA(insertOID=1039 (getdatabaseencodingPGUID11ftf0f19"0"10000100getdatabaseencoding- ));
2113+
DESCR("encoding name of current database");
2114+
2115+
DATA(insertOID=1295 (pg_char_to_encodingPGUID11ftf1f23"19"10000100pg_char_to_encoding- ));
2116+
DESCR("convert encoding name to encoding id");
2117+
2118+
DATA(insertOID=1597 (pg_encoding_to_charPGUID11ftf1f19"23"10000100pg_encoding_to_char- ));
2119+
DESCR("convert encoding id to encoding name");
21132120

21142121
/* System-view support functions */
21152122
DATA(insertOID=1640 (pg_get_ruledefPGUID11ftf1f25"19"10000100pg_get_ruledef- ));

‎src/include/mb/pg_wchar.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: pg_wchar.h,v 1.12 2000/01/15 18:30:35 petere Exp $ */
1+
/* $Id: pg_wchar.h,v 1.13 2000/01/18 05:08:31 ishii Exp $ */
22

33
#ifndefPG_WCHAR_H
44
#definePG_WCHAR_H
@@ -121,8 +121,13 @@ extern intpg_get_client_encoding(void);
121121
externunsignedchar*pg_client_to_server(unsignedchar*,int);
122122
externunsignedchar*pg_server_to_client(unsignedchar*,int);
123123
externintpg_valid_client_encoding(constchar*);
124+
125+
/* moved to miscadmin.h
126+
* pg_proc.h now have them.
124127
extern const char *pg_encoding_to_char(int);
125128
extern intpg_char_to_encoding(const char *);
129+
*/
130+
126131
externintGetDatabaseEncoding(void);
127132
externvoidSetDatabaseEncoding(int);
128133
externvoidSetTemplateEncoding(int);

‎src/include/miscadmin.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
* Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $Id: miscadmin.h,v 1.47 2000/01/13 18:26:15 petere Exp $
14+
* $Id: miscadmin.h,v 1.48 2000/01/18 05:08:29 ishii Exp $
1515
*
1616
* NOTES
1717
* some of the information in this file will be moved to
@@ -119,10 +119,12 @@ extern char *ExpandDatabasePath(const char *path);
119119
externvoidSetDatabaseName(constchar*name);
120120
externvoidSetDatabasePath(constchar*path);
121121

122-
/* even ifMB is not enabled, this function is neccesary
122+
/* even ifMULTIBYTE is not enabled, this function is neccesary
123123
* since pg_proc.h does have.
124124
*/
125125
externconstchar*getdatabaseencoding(void);
126+
externconstchar*pg_encoding_to_char(int);
127+
externintpg_char_to_encoding(constchar*);
126128

127129
externchar*getpgusername(void);
128130
externvoidSetPgUserName(void);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp