I'm trying to perform an SQL statement to extract usernames and crypt'd 
passwords from a database table, and am running into difficulties with 
chkpass.  I can run it just fine in a straight query, but when I try to use 
it on a column from an SQL statement I get an error.

scamp=# SELECT CHKPASS('foo');
    chkpass
----------------
 :Zbcg0W4wPBNBU
(1 row)

scamp=# SELECT CHKPASS(Password) FROM EmailAddress;
ERROR:  Function chkpass(character varying) does not exist
        Unable to identify a function that satisfies the given argument types
        You may need to add explicit typecasts
scamp=# SELECT CHKPASS(Password::TEXT) FROM EmailAddress;
ERROR:  Function chkpass(text) does not exist
        Unable to identify a function that satisfies the given argument types
        You may need to add explicit typecasts
scamp=# SELECT CHKPASS(Password::CSTRING) FROM EmailAddress;
ERROR:  Cannot cast type character varying to cstring

Does anyone have any suggestions on how I could accomplish the above?

-- 
/* Michael A. Nachbaur <[EMAIL PROTECTED]>
 * http://nachbaur.com/pgpkey.asc
 */

...[Arthur] leapt to his feet like an author hearing the phone ring...


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to