Re: How to encode and decode password in pgsql !!

Поиск
Список
Период
Сортировка
От darcy@druid.net (D'Arcy J.M. Cain)
Тема Re: How to encode and decode password in pgsql !!
Дата
Msg-id 20010503124607.5E9E11A77@druid.net
обсуждение исходный текст
Ответ на How to encode and decode password in pgsql !!  ("Subhramanya Shiva" <shiva@archeanit.com>)
Ответы Re: How to encode and decode password in pgsql !!
Re: How to encode and decode password in pgsql !!
Список pgsql-sql
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/I2 | :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/I2 | 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.


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Subhramanya Shiva"
Дата:
Сообщение: How to encode and decode password in pgsql !!
Следующее
От: "Albert REINER"
Дата:
Сообщение: '13 months ago'::reltime