| From: | tender wang <tndrwang(at)gmail(dot)com> |
|---|---|
| To: | Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> |
| Cc: | Xiaoran Wang <wxiaoran(at)vmware(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: [PATCH] Use RelationClose rather than table_close in heap_create_with_catalog |
| Date: | 2023-05-10 14:38:27 |
| Message-ID: | CAHewXNk+8OAuE0JMM9Vuj4srx2TpcrRxEU_GmF_2RpgEjt1=vQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> 于2023年5月10日周三
22:17写道:
> On Sat, Mar 18, 2023 at 12:34 PM Xiaoran Wang <wxiaoran(at)vmware(dot)com> wrote:
> >
> > Hi hackers,
> >
> > In heap_create_with_catalog, the Relation new_rel_desc is created
> > by RelationBuildLocalRelation, not table_open. So it's better to
> > call RelationClose to release it.
> >
> > What's more, the comment for it seems useless, just delete it.
>
> Essentially, all the close functions are the same with NoLock, IOW,
> table_close(relation, NoLock) = relation_closerelation, NoLock) =
> RelationClose(relation). Therefore, table_close(new_rel_desc, NoLock);
> looks fine to me.
Agreed.
And, the /* do not unlock till end of xact */, it looks like it's been
> there from day 1. It may be indicating that the ref count fo the new
> relation created in heap_create_with_catalog() will be decremented at
> the end of xact, but I'm not sure what it means.
>
Me too
> --
> Bharath Rupireddy
> PostgreSQL Contributors Team
> RDS Open Source Databases
> Amazon Web Services: https://aws.amazon.com
>
>
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Kirk Wolak | 2023-05-10 15:32:44 | Discussion: psql \et <trigger_name> -> edit the trigger function |
| Previous Message | Bharath Rupireddy | 2023-05-10 14:17:24 | Re: [PATCH] Use RelationClose rather than table_close in heap_create_with_catalog |