summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorNathan Bossart <nathan@postgresql.org>2023-08-23 07:49:03 -0700
committerNathan Bossart <nathan@postgresql.org>2023-08-23 07:49:03 -0700
commit260a1f18dae8729f99cefe4e1f759193fd6bedd0 (patch)
tree63fa3c210deaf8877d786c03351eadc88d73a734 /src/include
parentccadf73163ca88bdaa74b8223d4dde05d17f550b (diff)
Add to_bin() and to_oct().
This commit introduces functions for converting numbers to their equivalent binary and octal representations. Also, the base conversion code for these functions and to_hex() has been moved to a common helper function. Co-authored-by: Eric Radman Reviewed-by: Ian Barwick, Dag Lem, Vignesh C, Tom Lane, Peter Eisentraut, Kirk Wolak, Vik Fearing, John Naylor, Dean Rasheed Discussion: https://postgr.es/m/Y6IyTQQ/TsD5wnsH%40vm3.eradman.com
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/pg_proc.dat12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 12fac15ceb2..e893b49eb88 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -3707,6 +3707,18 @@
{ oid => '2768', descr => 'split string by pattern',
proname => 'regexp_split_to_array', prorettype => '_text',
proargtypes => 'text text text', prosrc => 'regexp_split_to_array' },
+{ oid => '9030', descr => 'convert int4 number to binary',
+ proname => 'to_bin', prorettype => 'text', proargtypes => 'int4',
+ prosrc => 'to_bin32' },
+{ oid => '9031', descr => 'convert int8 number to binary',
+ proname => 'to_bin', prorettype => 'text', proargtypes => 'int8',
+ prosrc => 'to_bin64' },
+{ oid => '9032', descr => 'convert int4 number to oct',
+ proname => 'to_oct', prorettype => 'text', proargtypes => 'int4',
+ prosrc => 'to_oct32' },
+{ oid => '9033', descr => 'convert int8 number to oct',
+ proname => 'to_oct', prorettype => 'text', proargtypes => 'int8',
+ prosrc => 'to_oct64' },
{ oid => '2089', descr => 'convert int4 number to hex',
proname => 'to_hex', prorettype => 'text', proargtypes => 'int4',
prosrc => 'to_hex32' },