aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
authorTatsuo Ishii <ishii@postgresql.org>2001-09-23 10:59:45 +0000
committerTatsuo Ishii <ishii@postgresql.org>2001-09-23 10:59:45 +0000
commitbe629abfc85dd4a51b53a27a472f79f94f95de0f (patch)
treea4acc5e4614829c15126d26913a0d4b0a1725007 /src/backend/utils
parentfae50f873f85a1d8ec0b88dfff12d922eca2da8d (diff)
downloadpostgresql-be629abfc85dd4a51b53a27a472f79f94f95de0f.tar.gz
postgresql-be629abfc85dd4a51b53a27a472f79f94f95de0f.zip
Add pg_database_encoding_max_length() function.
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/mb/wchar.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/backend/utils/mb/wchar.c b/src/backend/utils/mb/wchar.c
index 2da50bdd175..445e0e503aa 100644
--- a/src/backend/utils/mb/wchar.c
+++ b/src/backend/utils/mb/wchar.c
@@ -1,7 +1,7 @@
/*
* conversion functions between pg_wchar and multi-byte streams.
* Tatsuo Ishii
- * $Id: wchar.c,v 1.21 2001/09/21 15:27:38 tgl Exp $
+ * $Id: wchar.c,v 1.22 2001/09/23 10:59:45 ishii Exp $
*
* WIN1250 client encoding updated by Pavel Behal
*
@@ -573,4 +573,14 @@ pg_verifymbstr(const unsigned char *mbstr, int len)
}
return NULL;
}
+
+/*
+ * fetch maximum length of a char encoding for the current database
+ */
+int
+pg_database_encoding_max_length(void)
+{
+ return pg_wchar_table[GetDatabaseEncoding()].maxmblen;
+}
+
#endif