pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Subhramanya Shiva <shiva@archeanit.com>
To: pgsql-sql@postgresql.org
Subject: Re: How to encode and decode password in pgsql !!
Date: Thu, 3 May 2001 23:44:50 +0530 (IST)
Message-ID: <1163.192.168.0.2.988913690.squirrel@mail.archeanit.net> (raw)
In-Reply-To: <20010503124607.5E9E11A77@druid.net>
References: <20010503124607.5E9E11A77@druid.net>

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 <darcy@{druid|vex}.net>   |  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





view thread (8+ messages)  latest in thread

Message-ID: <1163.192.168.0.2.988913690.squirrel@mail.archeanit.net>
Permalink:  ../1163.192.168.0.2.988913690.squirrel@mail.archeanit.net/
Also on:    postgresql.org/message-id/1163.192.168.0.2.988913690.squirrel@mail.archeanit.net

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: shiva@archeanit.com
  Subject: Re: How to encode and decode password in pgsql !!
  In-Reply-To: <1163.192.168.0.2.988913690.squirrel@mail.archeanit.net>
  References: <20010503124607.5E9E11A77@druid.net> <1163.192.168.0.2.988913690.squirrel@mail.archeanit.net>

* 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