Re: Order by lower(column-alias) doesn't work...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Joseph Krogh <andreas(at)visena(dot)com>
Cc: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Order by lower(column-alias) doesn't work...
Date: 2020-05-28 13:26:42
Message-ID: 6288.1590672402@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andreas Joseph Krogh <andreas(at)visena(dot)com> writes:
> Is there a way to define "sorting-rules" on custom-types so that I can have
> ORDER BY <my_array_of_custom_types_alias> and PG will pick my custom odering?

You'd have to write your own type, which would be a lotta work :-(.

A possible partial answer is to define the composite type as

firstname citext, lastname citext, other-fields-here

and then the regular composite-type comparison rule would give you
approximately what you said you wanted ... but only approximately.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Joseph Krogh 2020-05-28 13:36:06 Re: Order by lower(column-alias) doesn't work...
Previous Message Andreas Joseph Krogh 2020-05-28 12:55:55 Re: Order by lower(column-alias) doesn't work...