| От | Tom Lane |
|---|---|
| Тема | Re: Going crazy comparing bytea columns |
| Дата | |
| Msg-id | 15238.1141247046@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Going crazy comparing bytea columns (scomp@canada.com) |
| Список | pgsql-general |
scomp@canada.com writes:
> I am using npgsql with C# to insert a bytea value into a
> column which will serve as an encrypted password. This works
> well. However, when I retrieve the value, it is different.
> In other words, "select pwd from table where pwd like @pwd"
> does not work.
Why are you using LIKE when you apparently want simple equality?
ISTM that LIKE opens up a whole can of worms with possible appearance
of the wildcards (% and _, not to mention \) in the string.
Another likely source of trouble is that you're not dealing with
escaping of non-ASCII byte values the same way when you insert
the password as when you try to look it up.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера