Unnecessary smgropen in {heapam_relation,index}_copy_data?

From: Japin Li <japinli(at)hotmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Unnecessary smgropen in {heapam_relation,index}_copy_data?
Date: 2024-01-23 04:51:45
Message-ID: ME3P282MB316600FA62F6605477F26F6AB6742@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hi, hackers

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.

Attachment Content-Type Size
v1-0001-Remove-unnecessary-smgropen.patch text/x-diff 2.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2024-01-23 05:00:00 Re: core dumps in auto_prewarm, tests succeed
Previous Message Ashutosh Bapat 2024-01-23 04:46:49 Re: Report planning memory in EXPLAIN ANALYZE