Re: PQunescapebytea not reverse of PQescapebytea?

Поиск
Список
Период
Сортировка
От Florian Weimer
Тема Re: PQunescapebytea not reverse of PQescapebytea?
Дата
Msg-id 87bnx20w88.fsf@mid.deneb.enyo.de
обсуждение исходный текст
Ответ на PQunescapebytea not reverse of PQescapebytea?  (Karthik Segpi <karthik.segpi@gmail.com>)
Ответы Re: PQunescapebytea not reverse of PQescapebytea?  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-interfaces
* Karthik Segpi:

> I have a 'bytea' column in the database, onto which my custom C application
> is inserting encrypted data. Before inserting, I am calling
> 'PQescapebytea()' to escape the ciphertext. However, after SELECT, the data
> needs to be 'un-escaped' before attempting to decrypt. I am trying to
> 'un-escape' using 'PQunescapebytea'. However, I am finding that
> 'PQunescapebytea' is not  exact inverse of 'PQescapebytea'. I saw
> documentation and posts in the mailing lists alluding to this as well. As a
> result, the decryption always fails.

Can you show us some example data that shows the inconsistency?
PQunescapebytea should give you back the blob you passed to
PQescapebytea, but the same blob can have different BYTEA
encodings—not everyone uses the \x hexadecimal encoding.



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

Предыдущее
От: David Wall
Дата:
Сообщение: Re: Which Java class in the new java.time package shall be used to mapped timestamp?
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: PQunescapebytea not reverse of PQescapebytea?