Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE
От | Chao Li |
---|---|
Тема | Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE |
Дата | |
Msg-id | 468D0F1F-1959-4FEC-A16D-C3B3AB7C8730@gmail.com обсуждение исходный текст |
Ответ на | RE: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE ("Aya Iwata (Fujitsu)" <iwata.aya@fujitsu.com>) |
Список | pgsql-hackers |
On Oct 10, 2025, at 17:04, Aya Iwata (Fujitsu) <iwata.aya@fujitsu.com> wrote:3 - bgworker.h
```
+extern void TerminateBackgroundWorkersByOid(Oid databaseId);
```
An OID can represent a lot of things. So, instead of suggesting the OID type by parameter name, I wonder if it is better do that with the function name, like TerminateBgWorkersByDbOid(Oid oid)
After receiving your comment, I checked other functions and there is no other examples like XXOid function in the code.
If this function use only here, original code is using databaseId in argument and it clear what Oid is.
I think original name is fine because it's not a function that's called much elsewhere.
By searching for “ByOid”, we can get some existing examples:
ObjectAddress
RefreshMatViewByOid(Oid matviewOid, bool is_create, bool skipData,
bool concurrent, const char *queryString,
QueryCompletion *qc)
The function name clearly tells refresh MatView by Oid, so the oid in parameter is an old of mat view.
ResultRelInfo *
ExecLookupResultRelByOid(ModifyTableState *node, Oid resultoid,
bool missing_ok, bool update_cache)
The function name indicates ResultRel, so the oid is a result oid.
AccessMethodInfo *
findAccessMethodByOid(Oid oid)
The function name tells to find access method, the the oid is an access method’s OID.
You can find more …
But in this patch, the function name only indeeds “terminate background workers”, while the oid is a database oid. Maybe we can rename the function to “TerminateDatabaseBgWorkersByOid()”.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
HighGo Software Co., Ltd.
https://www.highgo.com/
В списке pgsql-hackers по дате отправления: