-
+
Functions and Operators
translate('12345', '14', 'ax')
a23x5
+
+ |
+
+
+ text
+
+ Encodes binary data to ascii-only representation. Supported
+ types are: 'base64', 'hex'.
+
+ encode('123\\000\\001', 'base64')
+ MTIzAAE=
+
+
+ |
+
+
+ bytea
+
+ Decodes binary data from
string previously
+ encoded with encode(). Parameter type is same as in encode().
+
+ decode('MTIzAAE=', 'base64')
+ 123\000\001
+
#
# Makefile for utils/adt
#
-# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.49 2001/06/22 19:16:23 wieck Exp $
+# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.50 2001/07/11 22:14:02 momjian Exp $
#
subdir = src/backend/utils/adt
tid.o timestamp.o varbit.o varchar.o varlena.o version.o \
network.o mac.o inet_net_ntop.o inet_net_pton.o \
ri_triggers.o pg_lzcompress.o pg_locale.o formatting.o \
- ascii.o quote.o pgstatfuncs.o
+ ascii.o quote.o pgstatfuncs.o encode.o
all: SUBSYS.o
* 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.195 2001/06/22 19:16:24 wieck Exp $
+ * $Id: pg_proc.h,v 1.196 2001/07/11 22:14:02 momjian Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
DATA(insert OID = 1945 ( pg_stat_get_db_blocks_hit PGUID 12 f t t t 1 f 20 "26" 100 0 0 100 pg_stat_get_db_blocks_hit - ));
DESCR("Statistics: Block found in cache for database");
+DATA(insert OID = 1946 ( encode PGUID 12 f t t t 2 f 25 "17 25" 100 0 0 100 binary_encode - ));
+DESCR("Convert bytea value into some ascii-only text string");
+DATA(insert OID = 1947 ( decode PGUID 12 f t t t 2 f 17 "25 25" 100 0 0 100 binary_decode - ));
+DESCR("Convert ascii-encoded text string into bytea value");
+
/*
* prototypes for functions pg_proc.c
*/
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: builtins.h,v 1.156 2001/06/25 21:11:45 tgl Exp $
+ * $Id: builtins.h,v 1.157 2001/07/11 22:14:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern Datum byteaGetBit(PG_FUNCTION_ARGS);
extern Datum byteaSetByte(PG_FUNCTION_ARGS);
extern Datum byteaSetBit(PG_FUNCTION_ARGS);
+extern Datum binary_encode(PG_FUNCTION_ARGS);
+extern Datum binary_decode(PG_FUNCTION_ARGS);
/* version.c */
extern Datum pgsql_version(PG_FUNCTION_ARGS);