Re: [FeatureRequest] Base Convert Function

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tomáš Mudruňka <tomas(at)mudrunka(dot)cz>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [FeatureRequest] Base Convert Function
Date: 2010-12-21 12:04:41
Message-ID: AANLkTikZ8TLjRdtMOK22HKbSRiDk-xsFXtR1j7SRPJZs@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dne 21. prosince 2010 12:48 Robert Haas <robertmhaas(at)gmail(dot)com> napsal(a):
> 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...

Most used transformations are available from core now - just need a
wrapper function.

This functions isn't a clean, - should be based on int, long int or bytea?

Pavel

>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message tv 2010-12-21 12:25:44 Re: proposal : cross-column stats
Previous Message gsdfg gdfg 2010-12-21 12:04:03 Owner inheritance