Re: Unnecessary smgropen in {heapam_relation,index}_copy_data?

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Japin Li <japinli(at)hotmail(dot)com>
Subject: Re: Unnecessary smgropen in {heapam_relation,index}_copy_data?
Date: 2024-01-25 13:43:09
Message-ID: CAJ7c6TMNwD8Hi1DCNNBqE0LpmVWaGXdbr65T22XcxAotewyFcg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> I find heapam_relation_copy_data() and index_copy_data() have the following code:
>
> dstrel = smgropen(*newrlocator, rel->rd_backend);
>
> ...
>
> RelationCreateStorage(*newrlocator, rel->rd_rel->relpersistence, true);
>
> The smgropen() is also called by RelationCreateStorage(), why should we call
> smgropen() explicitly here?
>
> I try to remove the smgropen(), and all tests passed.

That's a very good question. Note that the second argument of
smgropen() used to create dstrel changes after applying your patch.
I'm not 100% sure whether this is significant or not.

I added your patch to the nearest open commitfest so that we will not lose it:

https://commitfest.postgresql.org/47/4794/

--
Best regards,
Aleksander Alekseev

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2024-01-25 13:45:52 Re: [PATCH] Add native windows on arm64 support
Previous Message Dave Cramer 2024-01-25 13:31:07 Re: [PATCH] Add native windows on arm64 support