Re: [FeatureRequest] Base Convert Function

From: Pavel Golub <pavel(at)microolap(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Pgsql hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [FeatureRequest] Base Convert Function
Date: 2010-12-21 21:28:17
Message-ID: 1456440058.20101221232817@gf.microolap.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello, Pavel.

You wrote:

PS> Hello

PS> Dne 21. prosince 2010 21:11 Tomáš Mudruňka <tomas(at)mudrunka(dot)cz> napsal(a):
>>
>> Thx for you answers :-)
>> Well... i know that i can write my own plugin and i am familiar with C so
>> this is not the problem, but i think that such feature should be
>> implemented directly in PgSQL because there are already functions for
>> converting to/from base 16 so why don't make this more flexible and
>> generalize it to any other radix? It's quite simple to do and i don't see
>> any reason why 16 should be there and 8, 32 or 36 shouldn't :-)
>>

PS> * It isn't a typical and often request,
PS> * There are not hard breaks for custom implementation,
PS> * You can use plperu or plpython based solutions,
PS> * It's not part of ANSI SQL

But MySQL has such function. What's wrong with us? ;)

PS> Regards

PS> Pavel Stehule

>> peace
>>
>> On Tue, 21 Dec 2010 15:04:03 +0100, Florian Pflug <fgp(at)phlo(dot)org> wrote:
>>> On Dec21, 2010, at 12:48 , Robert Haas wrote:
>>>> 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().
>>>
>>> If you're not comfortable doing this in C, you might also want to
>> consider
>>> one of procedural languages pl/pgsql, pl/perl, pl/python. pl/pgsql is
>>> probably
>>> only viable if you just need this for ints and bigints, unless you don't
>>> care about performance.
>>>
>>> best regards,
>>> Florian Pflug
>>
>> --
>> S pozdravem
>> Best regards
>>   Tomáš Mudruňka - Spoje.net / Arachne Labs
>>
>> XMPP/Jabber: harvie(at)jabbim(dot)cz, ICQ: 283782978
>>
>> --
>> 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
>>

--
With best wishes,
Pavel mailto:pavel(at)gf(dot)microolap(dot)com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Quan Zongliang 2010-12-21 21:36:11 Re: Patch BUG #5103: "pg_ctl -w (re)start" fails with custom unix_socket_directory
Previous Message David Fetter 2010-12-21 21:20:00 Re: wCTE behaviour