X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 8FAE9D1B4BC for ; Thu, 11 Dec 2003 18:35:01 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 87419-06 for ; Thu, 11 Dec 2003 14:34:30 -0400 (AST) Received: from starbucks.sunwave.net (Helium.sunwave.net [64.141.16.15]) by svr1.postgresql.org (Postfix) with ESMTP id A59A6D1D479 for ; Thu, 11 Dec 2003 14:34:29 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by starbucks.sunwave.net (Postfix) with ESMTP id B52CD178003 for ; Thu, 11 Dec 2003 13:34:14 -0500 (EST) From: Michael A Nachbaur To: pgsql-sql@postgresql.org Subject: Using chkpass() in a query Date: Thu, 11 Dec 2003 10:34:14 -0800 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200312111034.14571.mike@nachbaur.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/89 X-Sequence-Number: 16255 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 * http://nachbaur.com/pgpkey.asc */ ...[Arthur] leapt to his feet like an author hearing the phone ring...