Received: from mail.archeanit.net ([202.9.184.219]) by postgresql.org (8.11.3/8.11.1) with SMTP id f446AqA52028 for ; Fri, 4 May 2001 02:10:53 -0400 (EDT) (envelope-from shiva@archeanit.com) Received: (qmail 4124 invoked from network); 3 May 2001 18:14:50 -0000 Received: from unknown (HELO archeanit.com) (127.0.0.1) by 127.0.0.1 with SMTP; 3 May 2001 18:14:50 -0000 Received: from 192.168.0.2 (SquirrelMail authenticated user shiva) by mail.archeanit.net with HTTP; Thu, 3 May 2001 23:44:50 +0530 (IST) Message-ID: <1163.192.168.0.2.988913690.squirrel@mail.archeanit.net> Date: Thu, 3 May 2001 23:44:50 +0530 (IST) Subject: Re: How to encode and decode password in pgsql !! From: "Subhramanya Shiva" To: pgsql-sql@postgresql.org In-Reply-To: <20010503124607.5E9E11A77@druid.net> References: <20010503124607.5E9E11A77@druid.net> X-Mailer: SquirrelMail (version 0.5) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200105/19 X-Sequence-Number: 2817 i could not find chkpass in pgsql datatypes ... it is giving error called : Unable to locate type name chkpass in catalog. what shall i do ?? regards Shiva. > Thus spake Subhramanya Shiva > > how to store password details in a table. in encoded form > > and how to decode it. > > > > in mysql ...we r having encoding and decoding for a password > > security ... so how to do in pgsql... > > You use the chkpass type that I just commited to the distribution (finally.) > Here is an example of its usage. > > darcy=# CREATE TABLE x (i serial, p chkpass); > NOTICE: CREATE TABLE will create implicit sequence 'x_i_seq' for SERIAL column 'x.i' > NOTICE: CREATE TABLE/UNIQUE will create implicit index 'x_i_key' for table 'x' > CREATE > darcy=# INSERT INTO x (p) VALUES ('hello'); > INSERT 805247 1 > darcy=# INSERT INTO x (p) VALUES ('goodbye'); > INSERT 805248 1 > darcy=# SELECT * FROM x; > i | p > ---+---------------- > 1 | :SoLA2YFpQYV/I > 2 | :Sg8CKkFqqTGec > (2 rows) > > darcy=# SELECT p = 'hello' FROM x WHERE i = 1; > ?column? > ---------- > t > (1 row) > > darcy=# SELECT p = 'hello' FROM x WHERE i = 2; > ?column? > ---------- > f > (1 row) > > darcy=# SELECT i, raw(p) FROM x; > i | raw > ---+--------------- > 1 | SoLA2YFpQYV/I > 2 | Sg8CKkFqqTGec > (2 rows) > > -- > D'Arcy J.M. Cain | Democracy is three wolves > http://www.druid.net/darcy/ | and a sheep voting on > +1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner. > -- Subhramanya Shiva, Programmer Archean InfoTech pvt.Ltd. Hyderabad, India http://www.archeanit.com