public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: Andreas Joseph Krogh <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: ORDER BY elements in ARRAY
Date: Tue, 27 Aug 2024 09:03:37 -0700
Message-ID: <CAKFQuwZRaJ4AHNQZgs6pNru_WGm5MOjH+mHa3dWELNS=N_4j6w@mail.gmail.com> (raw)
In-Reply-To: <VisenaEmail.22.4c3384825217cb30.1919450fe29@origo-test01.app.internal.visena.net>
References: <VisenaEmail.11.efc8bf0cbc6c75fa.1919390a6d7@origo-test01.app.internal.visena.net>
	<CAKFQuwZtFH9ZdrTvRMrE=Xq-HU0-xsmbfzmcyeSG7O5svtHW0Q@mail.gmail.com>
	<VisenaEmail.22.4c3384825217cb30.1919450fe29@origo-test01.app.internal.visena.net>

On Tuesday, August 27, 2024, Andreas Joseph Krogh <[email protected]>
wrote:

> På tirsdag 27. august 2024 kl. 14:39:34, skrev David G. Johnston <
> [email protected]>:
>
> […]
> Add order by here
>
>>        ) as person_array
>>
>> FROM onp_crm_relation comp
>> ORDER BY person_array
>> ;
>>
>>
> David J.
>
>
>
> This doesn't really do it. I'm looking for something analogous to Java's
> Comparator-interface so the custom datatype knows how to sort itself.
>

Ah.  Then either just put those two values into the first two field
positions of your custom type and live with an easy, but also
self-contained, hack, or figure out what incantations of create operator
and/or create operator family are need to install custom behavior for the
b-tree < and > operators.  I’m 80% sure it’s doable, 60% in plpgsql…

David J.


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: ORDER BY elements in ARRAY
  In-Reply-To: <CAKFQuwZRaJ4AHNQZgs6pNru_WGm5MOjH+mHa3dWELNS=N_4j6w@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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