libpq: PQfnumber overload for not null-terminated strings

Поиск
Список
Период
Сортировка
От Ivan Trofimov
Тема libpq: PQfnumber overload for not null-terminated strings
Дата
Msg-id dd771e4c-1ec8-e145-fdff-a6e08f543831@yandex.ru
обсуждение исходный текст
Ответы Re: libpq: PQfnumber overload for not null-terminated strings  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi!

This one comes from C++'s `std::string_view`: being just a `const char*` 
plus the `size`, it's a very convenient type to use in interfaces which 
don't need an ownership of the data passed in.

Unfortunately, `PQfnumber` expects a null-terminated string, which 
`std::string_view` can not guarantee, and this limitations affects the 
interfaces built on top of libpq.

Would you be willing to review a patch that adds an `PQfnumber` overload 
that takes a `field_name` size as well?



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

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: RFC: Logging plan of the running query
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: RangeTblEntry jumble omissions