PQunescapebytea not reverse of PQescapebytea?

Поиск
Список
Период
Сортировка
От Karthik Segpi
Тема PQunescapebytea not reverse of PQescapebytea?
Дата
Msg-id CACD7L9FTet=B=DFwLO1SgaNNukeK6poVxLm524zHtBcmac6ttg@mail.gmail.com
обсуждение исходный текст
Ответы Re: PQunescapebytea not reverse of PQescapebytea?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi -
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.

Is there another C method out there that does exact inverse of
'PQescapebytea'? If the answer is no, then what other options do I have? I
could think of the following:

1. Write my own C method that does exactly the inverse of 'PQescapebytea'
2. Instead of using 'PQescapebytea', base64 encode ciphertext before
inserting. Not sure how well this would work.
3.  Use 'text' data type for the column instead of 'bytea'.

Has anyone faced this scenario before?

Thanks-
Karthik

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

Предыдущее
От: "George Weaver"
Дата:
Сообщение: Re: Replacing Ordinal Suffixes
Следующее
От: Steve Atkins
Дата:
Сообщение: Re: Replacing Ordinal Suffixes