Re: [PATCH] Extend the length of BackgroundWorker.bgw_library_name

Поиск
Список
Период
Сортировка
От Aleksander Alekseev
Тема Re: [PATCH] Extend the length of BackgroundWorker.bgw_library_name
Дата
Msg-id CAJ7c6TOj44NhDGdFyd0d8Axd8y9kjhL=m0iC_O97qMzVGEuabw@mail.gmail.com
обсуждение исходный текст
Ответ на [PATCH] Extend the length of BackgroundWorker.bgw_library_name  (Yurii Rashkovskii <yrashk@gmail.com>)
Ответы Re: [PATCH] Extend the length of BackgroundWorker.bgw_library_name
Список pgsql-hackers
Hi,

> The trade-off of this patch is that the `BackgroundWorker` structure becomes larger. From my perspective, this is a
reasonablecost (less than a kilobyte of extra space per worker).
 

Agree.

> The patch is backwards-compatible and ensures that bgw_library_name stays *at least* as long as BGW_MAXLEN. Existing
externalcode that uses BGW_MAXLEN is a length boundary (for example, in `strncpy`) will continue to work as expected.
 

There is a mistake in the comment though:

```
+/*
+ * Ensure bgw_function_name's size is backwards-compatible and sensible
+ */
+StaticAssertDecl(MAXPGPATH >= BGW_MAXLEN, "MAXPGPATH must be at least
equal to BGW_MAXLEN");
```

library_name, not function_name. Also I think the comment should be
more detailed, something like "prior to PG17 we used ... but since
PG17 ... which may cause problems if ...".

-- 
Best regards,
Aleksander Alekseev



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Etsuro Fujita
Дата:
Сообщение: Re: postgres_fdw: wrong results with self join + enable_nestloop off
Следующее
От: Ajit Awekar
Дата:
Сообщение: Re: Memory leak in CachememoryContext