On 2025-12-20 04:09, Hans Henrik Bergan wrote:



btw pg_escape_literal is mis-named. it does not escape - it quotes.
And there is an important difference between escaping and quoting,
at least for SQLite, it is impossible to make a binary-safe escape() function,
but it's fully possible to make a binary-safe quote() function
(see https://github.com/php/php-src/pull/13972 <https://github.com/php/ php-src/pull/13972> )

IMO pg_escape_literal should be renamed pg_quote_literal.
>
quote_literal() is how PostgreSQL itself names the function, and it would be consistent with PHP's functions being named to reflect those that it wraps (à la mysqli_real_escape_string()).

Instead, I think it got called pg_escape_string() by symmetry with mysql_escape_string().

Reply via email to