| From: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
|---|---|
| To: | Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Improve comment in function GetPublicationRelations |
| Date: | 2025-12-10 13:30:02 |
| Message-ID: | 7251A359-6710-4366-88DD-17F274FB6748@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
> On Dec 10, 2025, at 19:15, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com> wrote:
>
> Hi,
>
> While working on the thread [1], we found that the comment in the
> function GetPublicationRelations is not correct. This function gets
> the list of relations associated with the publication, but the comment
> says the opposite :
> /* Find all publications associated with the relation. */
>
> Attached a patch to fix it.
>
> [1]: https://www.postgresql.org/message-id/CANhcyEV_EVi5cgJ6WPvmeVAqjCS7Of%2BVAWuRHZtsVf8PQb_z7g%40mail.gmail.com
>
> Thanks,
> Shlok Kyal
> <v1-0001-Improve-comment-in-function-GetPublicationRelatio.patch>
Looking at the code:
```
/* Find all publications associated with the relation. */
pubrelsrel = table_open(PublicationRelRelationId, AccessShareLock);
ScanKeyInit(&scankey,
Anum_pg_publication_rel_prpubid,
BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(pubid));
```
It queries the pg_publication table by a pubid, so, indeed, the fix is correct.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Kirill Reshke | 2025-12-10 13:32:06 | Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions |
| Previous Message | Heikki Linnakangas | 2025-12-10 13:28:34 | Re: [Patch] Improve the test src/test/postmaster/t/003_start_stop.pl |