pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Natural sort order extension.
3+ messages / 2 participants
[nested] [flat]

* Natural sort order extension.
@ 2020-02-12 15:45 Dmitry Igrishin <dmitigr@gmail.com>
  2020-02-12 16:55 ` Re: Natural sort order extension. Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 3+ messages in thread

From: Dmitry Igrishin @ 2020-02-12 15:45 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hi,

I've implemented a PostgreSQL extension for natural sort order. I.e.
strings like "z20", "z0004", "z11", "z2" sorted in ascending order as
"z2", "z0004", "z11", "z20".

Currently it implements the type textnso which is binary-coercible
to/from the text type. It's possible to declare table columns of type
textnso and create indexes on them.

Details are here https://github.com/dmitigr/pgnso

Any feedback are welcome!

Thanks.





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Natural sort order extension.
  2020-02-12 15:45 Natural sort order extension. Dmitry Igrishin <dmitigr@gmail.com>
@ 2020-02-12 16:55 ` Laurenz Albe <laurenz.albe@cybertec.at>
  2020-02-12 17:14   ` Re: Natural sort order extension. Dmitry Igrishin <dmitigr@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Laurenz Albe @ 2020-02-12 16:55 UTC (permalink / raw)
  To: Dmitry Igrishin <dmitigr@gmail.com>; pgsql-general@lists.postgresql.org

On Wed, 2020-02-12 at 18:45 +0300, Dmitry Igrishin wrote:
> I've implemented a PostgreSQL extension for natural sort order. I.e.
> strings like "z20", "z0004", "z11", "z2" sorted in ascending order as
> "z2", "z0004", "z11", "z20".
> 
> Currently it implements the type textnso which is binary-coercible
> to/from the text type. It's possible to declare table columns of type
> textnso and create indexes on them.
> 
> Details are here https://github.com/dmitigr/pgnso
> 
> Any feedback are welcome!

I don't want to detract from this, but from PostgreSQL v10 on you can use
ICU collations with the "kn-true" variant to have natural sort order.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Natural sort order extension.
  2020-02-12 15:45 Natural sort order extension. Dmitry Igrishin <dmitigr@gmail.com>
  2020-02-12 16:55 ` Re: Natural sort order extension. Laurenz Albe <laurenz.albe@cybertec.at>
@ 2020-02-12 17:14   ` Dmitry Igrishin <dmitigr@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Dmitry Igrishin @ 2020-02-12 17:14 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-general@lists.postgresql.org

On Wed, 12 Feb 2020, 19:55 Laurenz Albe, <laurenz.albe@cybertec.at> wrote:

> On Wed, 2020-02-12 at 18:45 +0300, Dmitry Igrishin wrote:
> > I've implemented a PostgreSQL extension for natural sort order. I.e.
> > strings like "z20", "z0004", "z11", "z2" sorted in ascending order as
> > "z2", "z0004", "z11", "z20".
> >
> > Currently it implements the type textnso which is binary-coercible
> > to/from the text type. It's possible to declare table columns of type
> > textnso and create indexes on them.
> >
> > Details are here https://github.com/dmitigr/pgnso
> >
> > Any feedback are welcome!
>
> I don't want to detract from this, but from PostgreSQL v10 on you can use
> ICU collations with the "kn-true" variant to have natural sort order.
>
Thanks for the point. But my extension works with default collation and
UTF-8 encoding. And ICU is not required.

>
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2020-02-12 17:14 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-02-12 15:45 Natural sort order extension. Dmitry Igrishin <dmitigr@gmail.com>
2020-02-12 16:55 ` Laurenz Albe <laurenz.albe@cybertec.at>
2020-02-12 17:14   ` Dmitry Igrishin <dmitigr@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox