Search Postgresql Archives

Re: Going crazy comparing bytea columns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 01, 2006 at 10:40:39AM -0800, scomp@xxxxxxxxxx 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux