pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael A Nachbaur <mike@nachbaur.com>
To: pgsql-sql@postgresql.org
Subject: Using chkpass() in a query
Date: Thu, 11 Dec 2003 10:34:14 -0800
Message-ID: <200312111034.14571.mike@nachbaur.com> (raw)

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 <mike@nachbaur.com>
 * http://nachbaur.com/pgpkey.asc
 */

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




Message-ID: <200312111034.14571.mike@nachbaur.com>
Permalink:  ../200312111034.14571.mike@nachbaur.com/
Also on:    postgresql.org/message-id/200312111034.14571.mike@nachbaur.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mike@nachbaur.com
  Subject: Re: Using chkpass() in a query
  In-Reply-To: <200312111034.14571.mike@nachbaur.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox