libpq: PQfnumber overload for not null-terminated strings - Mailing list pgsql-hackers

From Ivan Trofimov
Subject libpq: PQfnumber overload for not null-terminated strings
Date
Msg-id dd771e4c-1ec8-e145-fdff-a6e08f543831@yandex.ru
Whole thread Raw
Responses Re: libpq: PQfnumber overload for not null-terminated strings
List 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 by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: RFC: Logging plan of the running query
Next
From: Julien Rouhaud
Date:
Subject: Re: RangeTblEntry jumble omissions