Skip to content

Commit 317ff59

Browse files
committed
to_ascii( text )
- encode 'text' from database encoding to ASCII to_ascii('\256\341k') to_ascii( text, int4 ) - encode 'text' from 'int4' encoding to ASCII to_ascii('\256\341k', 8) to_ascii( text, name ) - encode 'text' from 'name' encoding to ASCII to_ascii('\256\341k', 'LATIN2') Now is supported LATIN1, LATIN2, WIN1250. For other character sets I haven't good resources. Add new encoding is easy... If encoding is not supported returns ERROR. Note --- not exists total corect conversion to ASCII, this function try convert chars those is _probably_ interpret-able in ASCII for others use ' '. But for example for all Czech characters it is sufficient ... hmm Chinese / JAP and other complicated langs have bad luck here :-( Karel
1 parent a1464e9 commit 317ff59

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/backend/utils/adt/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Makefile for utils/adt
33
#
4-
# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.41 2000/07/30 22:13:52 tgl Exp $
4+
# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.42 2000/08/04 15:45:07 momjian Exp $
55
#
66

77
subdir = src/backend/utils/adt
@@ -23,7 +23,8 @@ OBJS = acl.o arrayfuncs.o arrayutils.o bool.o cash.o char.o \
2323
regexp.o regproc.o ruleutils.o selfuncs.o sets.o \
2424
tid.o timestamp.o varbit.o varchar.o varlena.o version.o \
2525
network.o mac.o inet_net_ntop.o inet_net_pton.o \
26-
ri_triggers.o pg_lzcompress.o pg_locale.o formatting.o
26+
ri_triggers.o pg_lzcompress.o pg_locale.o formatting.o \
27+
ascii.o
2728

2829
all: SUBSYS.o
2930

src/include/catalog/pg_proc.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: pg_proc.h,v 1.157 2000/08/03 23:07:46 tgl Exp $
10+
* $Id: pg_proc.h,v 1.158 2000/08/04 15:45:12 momjian Exp $
1111
*
1212
* NOTES
1313
* The script catalog/genbki.sh reads this file and generates .bki
@@ -2442,6 +2442,14 @@ DESCR("aggregate transition function");
24422442
DATA(insert OID = 1844 ( interval_avg PGUID 12 f t t t 1 f 1186 "1187" 100 0 0 100 interval_avg - ));
24432443
DESCR("AVG aggregate final function");
24442444

2445+
/* To ASCII conversion */
2446+
DATA(insert OID = 1845 ( to_ascii PGUID 12 f t t t 1 f 25 "25" 100 0 0 100 to_ascii_default - ));
2447+
DESCR("encode text from DB encoding to ASCII text");
2448+
DATA(insert OID = 1846 ( to_ascii PGUID 12 f t t t 2 f 25 "25 23" 100 0 0 100 to_ascii_enc - ));
2449+
DESCR("encode text from encoding to ASCII text");
2450+
DATA(insert OID = 1847 ( to_ascii PGUID 12 f t t t 2 f 25 "25 19" 100 0 0 100 to_ascii_encname - ));
2451+
DESCR("encode text from encoding to ASCII text");
2452+
24452453
DATA(insert OID = 1850 ( int28eq PGUID 12 f t t t 2 f 16 "21 20" 100 0 0 100 int28eq - ));
24462454
DESCR("equal");
24472455
DATA(insert OID = 1851 ( int28ne PGUID 12 f t t t 2 f 16 "21 20" 100 0 0 100 int28ne - ));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy