From e82bcba5e07e7e46bacf9dba51425c26b2c35369 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Mon, 2 Sep 2002 05:53:23 +0000 Subject: [PATCH] Here's a doc patch for the new string functions recently committed -- replace, split, and to_hex. The patch also moves encode and decode into alphabetical order (since everything else in the table was). Joe Conway --- doc/src/sgml/func.sgml | 93 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 64 insertions(+), 29 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index ee8cc7d3f6..5334b191d6 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,5 +1,5 @@ @@ -1728,6 +1728,34 @@ PostgreSQL documentation + + decode(string text, + type text) + + bytea + + Decodes binary data from string previously + encoded with encode(). Parameter type is same as in encode(). + + decode('MTIzAAE=', 'base64') + 123\000\001 + + + + + encode(data bytea, + type text) + + text + + Encodes binary data to ASCII-only representation. Supported + types are: 'base64', 'hex', 'escape'. + + encode('123\\000\\001', 'base64') + MTIzAAE= + + + initcap(text) text Converts first letter of each word (whitespace separated) to upper case. @@ -1829,6 +1857,18 @@ PostgreSQL documentation + replace(string text, + from text, + to text) + text + Replace all occurrences in string of substring + from with substring to + + replace('abcdefabcdef', 'cd', 'XX') + abXXefabXXef + + + rpad(string text, length integer @@ -1859,6 +1899,18 @@ PostgreSQL documentation + split(string text, + delimiter text, + column integer) + text + Split string on delimiter + returning the resulting (one based) column number. + + split('abc~@~def~@~ghi','~@~',2) + def + + + strpos(string, substring) text @@ -1892,6 +1944,17 @@ PostgreSQL documentation + to_hex(number integer + or bigint) + text + Convert number to its equivalent hexadecimal + representation. + + to_hex(9223372036854775807::bigint) + 7fffffffffffffff + + + translate(string text, @@ -1909,34 +1972,6 @@ PostgreSQL documentation a23x5 - - - encode(data bytea, - type text) - - text - - Encodes binary data to ASCII-only representation. Supported - types are: 'base64', 'hex', 'escape'. - - encode('123\\000\\001', 'base64') - MTIzAAE= - - - - - decode(string text, - type text) - - bytea - - Decodes binary data from string previously - encoded with encode(). Parameter type is same as in encode(). - - decode('MTIzAAE=', 'base64') - 123\000\001 - - -- 2.11.0