On Wed, Mar 01, 2006 at 10:40:39AM -0800, scomp@canada.com wrote:
> 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.
Different how? Without knowing more I'd wonder it's a matter of
escaped vs. non-escaped bytea values.
> In other words, "select pwd from table where pwd like @pwd"
> does not work.
>
> Is it not possible to compare bytea columns?
I can't help with npgsql but it's certainly possible to compare
bytea columns. Incidentally, I don't know if this could be causing
any problems, but why are you using LIKE instead of "="?
> NpgsqlCommand cmd = new NpgsqlCommand("select pwd from table
> where usr = @usr and pwd like @pwd",dbConn);
What's the output of the following query?
SELECT pwd, @pwd FROM table WHERE usr = @usr
That should return the value in the database (pwd) and the value
you're providing (@pwd). Let's see how they differ.
--
Michael Fuhr