Re: Named Operators

Поиск
Список
Период
Сортировка
От Gurjeet Singh
Тема Re: Named Operators
Дата
Msg-id CABwTF4UnQf1L414+8Ls_9Qu4j1H-rzHyg6TzGmx2Omd9HS21pA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Named Operators  (Ted Yu <yuzhihong@gmail.com>)
Список pgsql-hackers
On Fri, Jan 20, 2023 at 9:32 AM Ted Yu <yuzhihong@gmail.com> wrote:
>
> Since `validIdentifier` doesn't modify the contents of `name` string, it seems that there is no need to create `tmp`
stringin `validNamedOperator`.
 
> You can pass the start and end offsets into the string (name) as second and third parameters to `validIdentifier`.

Thanks for reviewing the patch!

I was making a temporary copy of the string, since I had to modify it
before the validation, whereas the callee expects a `const char*`. I
agree that the same check can be done with more elegance, while
eliminating the temporary allocation. Please find the updated patch
attached.

Instead of passing the start and end of region I want to check, as
suggested, I'm now passing just the length of the string I want
validated. But I think that's for the better, since it now aligns with
the comment that validIdentifier() does not check if the passed string
is shorter than NAMEDATALEN.

Best regards,
Gurjeet
http://Gurje.et

Вложения

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

Предыдущее
От: "Takamichi Osumi (Fujitsu)"
Дата:
Сообщение: RE: Time delayed LR (WAS Re: logical replication restrictions)
Следующее
От: "Takamichi Osumi (Fujitsu)"
Дата:
Сообщение: RE: Time delayed LR (WAS Re: logical replication restrictions)