Re: [FeatureRequest] Base Convert Function

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tomáš Mudruňka <tomas(at)mudrunka(dot)cz>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [FeatureRequest] Base Convert Function
Date: 2010-12-21 11:48:16
Message-ID: AANLkTin40n=1nWBKkLmaWOaBrZ6txh+MR4+5wuvc0WMH@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/12/21 Tomáš Mudruňka <tomas(at)mudrunka(dot)cz>:
> Is there possibility of having internal base converting function in PgSQL?
> There are already functions for converting between decimal and hexadecimal
> notations i think pgsql can be able to convert between number with radixes
> from 1 to 36 (actually fast (de)encoding base36 is what i need)...

It should be pretty easy to write such a function in C, perhaps using
strtol() or strtoul(). Because PostgreSQL uses an extensible
architecture, you could load such a function into your copy of
PostgreSQL and use it in your environment even if it weren't part of
the core distribution. There are a number of existing "contrib"
modules that you can look at for examples of how to do this.

Whether or not we'd accept a patch to add such a function to core or
contrib, I'm not sure. Nobody's written one yet...

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-12-21 11:49:21 Re: Can postgres create a file with physically continuous blocks.
Previous Message Robert Haas 2010-12-21 11:40:49 Re: bug in SignalSomeChildren