agora inbox for pgsql-admin@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alexander Lipatov <lipatov@mindbox.cloud>
Cc: pgsql-admin@postgresql.org
Subject: Re: Custom ordering operator for type xid
Date: Mon, 17 Jun 2024 11:03:58 -0400
Message-ID: <3179495.1718636638@sss.pgh.pa.us> (raw)
In-Reply-To: <2EA9BF93-EE2B-4B84-B21D-5EA86FA63913@mindbox.cloud>
References: <2EA9BF93-EE2B-4B84-B21D-5EA86FA63913@mindbox.cloud>

Alexander Lipatov <lipatov@mindbox.cloud> writes:
> **Question**: Is it safe to create custom ordering operators for the `xid` type and a default operator class with these operators?

I wouldn't do it, mainly because the semantics of what you've written
have nothing to do with the actual behavior of xids.  (The real
comparison behavior is "circular", which can't be modeled as a total
order, which is why there's not a built-in opclass already.)

What is that ORM doing with XIDs anyway, and is there a good reason
not to run away screaming from such an ill-thought-out product?
I don't believe for a minute that this is going to be the only
semantic issue you'll run into with an ORM that thinks it knows
how XIDs behave despite a clear lack of even the most minimal
investigation into the question.

			regards, tom lane





view thread (4+ messages)  latest in thread

Message-ID: <3179495.1718636638@sss.pgh.pa.us>
Permalink:  ../3179495.1718636638@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3179495.1718636638@sss.pgh.pa.us

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: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, lipatov@mindbox.cloud
  Subject: Re: Custom ordering operator for type xid
  In-Reply-To: <3179495.1718636638@sss.pgh.pa.us>

* 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