agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedpgsql function for roman2decimal?
6+ messages / 3 participants
[nested] [flat]
* pgsql function for roman2decimal?
@ 2020-06-27 20:38 F Bax <fbax.ca@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: F Bax @ 2020-06-27 20:38 UTC (permalink / raw)
To: pgsql-sql@lists.postgresql.org
I found simple code for PHP to convert roman numeral to decimal here:
https://stackoverflow.com/questions/6265596/how-to-convert-a-roman-numeral-to-integer-in-php
Can this be accomplished with a pgsql function?
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pgsql function for roman2decimal?
@ 2020-06-27 21:01 Bruce Momjian <bruce@momjian.us>
parent: F Bax <fbax.ca@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: Bruce Momjian @ 2020-06-27 21:01 UTC (permalink / raw)
To: F Bax <fbax.ca@gmail.com>; +Cc: pgsql-sql@lists.postgresql.org
On Sat, Jun 27, 2020 at 04:38:59PM -0400, F Bax wrote:
> I found simple code for PHP to convert roman numeral to decimal here:
>
> https://stackoverflow.com/questions/6265596/
> how-to-convert-a-roman-numeral-to-integer-in-php
>
> Can this be accomplished with a pgsql function?
Someone worked on this in 2017 but it was never added due to lack of
interest. I am sure it can be cleaned up and added to PG 14 if there is
demand:
https://www.postgresql.org/message-id/flat/CAGMVOduAJ9wKqJXBYnmFmEetKxapJxrG3afUwpbOZ6n_dWaUnA%40mai...
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pgsql function for roman2decimal?
@ 2020-06-27 21:14 Erik Brandsberg <erik@heimdalldata.com>
parent: Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 6+ messages in thread
From: Erik Brandsberg @ 2020-06-27 21:14 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: F Bax <fbax.ca@gmail.com>; pgsql-sql@lists.postgresql.org
This really feels like something that should be part of a module and not
the core code.
On Sat, Jun 27, 2020 at 5:02 PM Bruce Momjian <bruce@momjian.us> wrote:
> On Sat, Jun 27, 2020 at 04:38:59PM -0400, F Bax wrote:
> > I found simple code for PHP to convert roman numeral to decimal here:
> >
> > https://stackoverflow.com/questions/6265596/
> > how-to-convert-a-roman-numeral-to-integer-in-php
> >
> > Can this be accomplished with a pgsql function?
>
> Someone worked on this in 2017 but it was never added due to lack of
> interest. I am sure it can be cleaned up and added to PG 14 if there is
> demand:
>
>
> https://www.postgresql.org/message-id/flat/CAGMVOduAJ9wKqJXBYnmFmEetKxapJxrG3afUwpbOZ6n_dWaUnA%40mai...
>
> --
> Bruce Momjian <bruce@momjian.us> https://momjian.us
> EnterpriseDB https://enterprisedb.com
>
> The usefulness of a cup is in its emptiness, Bruce Lee
>
>
>
>
--
*Erik Brandsberg*
erik@heimdalldata.com
www.heimdalldata.com
+1 (866) 433-2824 x 700
[image: AWS Competency Program]
<https://aws.amazon.com/partners/find/partnerdetails/?n=Heimdall%20Data&id=001E000001d9pndIAA;
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pgsql function for roman2decimal?
@ 2020-06-27 21:24 Bruce Momjian <bruce@momjian.us>
parent: Erik Brandsberg <erik@heimdalldata.com>
0 siblings, 1 reply; 6+ messages in thread
From: Bruce Momjian @ 2020-06-27 21:24 UTC (permalink / raw)
To: Erik Brandsberg <erik@heimdalldata.com>; +Cc: F Bax <fbax.ca@gmail.com>; pgsql-sql@lists.postgresql.org
On Sat, Jun 27, 2020 at 05:14:27PM -0400, Erik Brandsberg wrote:
> This really feels like something that should be part of a module and not the
> core code.
Well, we already do the numeric to Roman conversion, so doing the
reverse seems to make sense:
SELECT to_char(335, 'RN');
to_char
-----------------
CCCXXXV
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pgsql function for roman2decimal?
@ 2020-06-27 21:28 Erik Brandsberg <erik@heimdalldata.com>
parent: Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 6+ messages in thread
From: Erik Brandsberg @ 2020-06-27 21:28 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: F Bax <fbax.ca@gmail.com>; pgsql-sql@lists.postgresql.org
If the core code already does one direction (I didn't know this) then I
would agree. It seems that both would make sense to be in a
separate module, due to the rarity of use, possibly just as an "exotic
function" module, which would have a lower barrier of entry to adding code
to.
On Sat, Jun 27, 2020 at 5:24 PM Bruce Momjian <bruce@momjian.us> wrote:
> On Sat, Jun 27, 2020 at 05:14:27PM -0400, Erik Brandsberg wrote:
> > This really feels like something that should be part of a module and not
> the
> > core code.
>
> Well, we already do the numeric to Roman conversion, so doing the
> reverse seems to make sense:
>
> SELECT to_char(335, 'RN');
> to_char
> -----------------
> CCCXXXV
>
> --
> Bruce Momjian <bruce@momjian.us> https://momjian.us
> EnterpriseDB https://enterprisedb.com
>
> The usefulness of a cup is in its emptiness, Bruce Lee
>
>
--
*Erik Brandsberg*
erik@heimdalldata.com
www.heimdalldata.com
+1 (866) 433-2824 x 700
[image: AWS Competency Program]
<https://aws.amazon.com/partners/find/partnerdetails/?n=Heimdall%20Data&id=001E000001d9pndIAA;
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pgsql function for roman2decimal?
@ 2020-06-27 21:31 Bruce Momjian <bruce@momjian.us>
parent: Erik Brandsberg <erik@heimdalldata.com>
0 siblings, 0 replies; 6+ messages in thread
From: Bruce Momjian @ 2020-06-27 21:31 UTC (permalink / raw)
To: Erik Brandsberg <erik@heimdalldata.com>; +Cc: F Bax <fbax.ca@gmail.com>; pgsql-sql@lists.postgresql.org
On Sat, Jun 27, 2020 at 05:28:51PM -0400, Erik Brandsberg wrote:
> If the core code already does one direction (I didn't know this) then I would
> agree. It seems that both would make sense to be in a separate module, due to
> the rarity of use, possibly just as an "exotic function" module, which would
> have a lower barrier of entry to adding code to.
Well, I don't think we would remove the numeric to Roman conversion
since it would break backward compatibility, and it isn't much code, so
going in the forward direction of adding a Roman to numeric conversion
would make sense in the core code.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2020-06-27 21:31 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-06-27 20:38 pgsql function for roman2decimal? F Bax <fbax.ca@gmail.com>
2020-06-27 21:01 ` Bruce Momjian <bruce@momjian.us>
2020-06-27 21:14 ` Erik Brandsberg <erik@heimdalldata.com>
2020-06-27 21:24 ` Bruce Momjian <bruce@momjian.us>
2020-06-27 21:28 ` Erik Brandsberg <erik@heimdalldata.com>
2020-06-27 21:31 ` Bruce Momjian <bruce@momjian.us>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox