Search Postgresql Archives

Re: split_part for the last element

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 23, 2020 at 8:47 AM Nikhil Benesch <nikhil.benesch@xxxxxxxxx> wrote:
Is there another option I'm missing? Would there be interest in
extending split part so that negative indices counted from the end, as
in:

    split_part('foo bar baz', ' ', -1) -> 'baz'

Some thoughts:

I'm torn here because this would be the first usage of this concept in PostgreSQL (I think).

Tangentially, I noticed that we have a "starts_with" function but no corresponding "end_with".

It's been a while but there used to be a systemic inertia working against adding minor useful functions such as these.

With the new documentation layout I would at least consider updating the description for the normal functions with an example on how to formulate an _expression_ that works contra-normally, and in the case where there does exist such a specialized function, naming it.

David J.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux