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

2020-05-28 Thread Andreas Joseph Krogh
På torsdag 28. mai 2020 kl. 15:26:42, skrev Tom Lane mailto:t...@sss.pgh.pa.us>>: Andreas Joseph Krogh writes: > Is there a way to define "sorting-rules" on custom-types so that I can have > ORDER BY and PG will pick my custom odering? You'd have to write your own type, which would be a

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

2020-05-28 Thread Tom Lane
Andreas Joseph Krogh writes: > Is there a way to define "sorting-rules" on custom-types so that I can have > ORDER BY 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

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

2020-05-28 Thread Andreas Joseph Krogh
På torsdag 28. mai 2020 kl. 14:50:54, skrev Geoff Winkless mailto:pgsqlad...@geoff.dj>>: On Thu, 28 May 2020 at 13:14, Andreas Joseph Krogh wrote: > This works: > select p.firstname, p.lastname, p.firstname || p.lastname as fullname from onp_crm_person p order by fullname; > > But this

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

2020-05-28 Thread Geoff Winkless
On Thu, 28 May 2020 at 13:14, Andreas Joseph Krogh wrote: > This works: > select p.firstname, p.lastname, p.firstname || p.lastname as fullname from > onp_crm_person p order by fullname; > > But this doesn't: > select p.firstname, p.lastname, p.firstname || p.lastname as fullname from >