Compare variables of composite type with slightly different column types
Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.
You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:
docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t46017psql -h localhost -U postgresBuilt from patchset v2 (message #2), October 06, 2026 at 11:47 AM.
Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:
git clone --branch t46017_2 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t46017_2 && git checkout t46017_2Patchset v2 (message #2) is on t46017_2
Hi,
Researching on join selectivity improvement I stuck into the code in
rowtypes.c:
/*
* Have two matching columns, they must be same type
*/
if (att1->atttypid != att2->atttypid)
ereport(ERROR, ...
Why, for example, isn't allowed next trivial query:
SELECT *
FROM
(SELECT ROW(1::integer, 'robert'::text)) AS s1,
(SELECT ROW(1::bigint, 'robert'::name)) AS s2
WHERE s1 = s2;
I guess, here the compatible_oper() routine can be used to find a
appropriate operator, or something like that can be invented.
I looked into the 2cd7084 and a4424c5, but don't found any rationale.
--
Regards
Andrey Lepikhov
Postgres Professional
On 26/5/2022 14:25, Andrey Lepikhov wrote:
I guess, here the compatible_oper() routine can be used to find a
appropriate operator, or something like that can be invented.
I looked into the 2cd7084 and a4424c5, but don't found any rationale.
In accordance to this idea I prepared a code. For a demo only.
--
regards,
Andrey Lepikhov
Postgres Professional