Re: MAY I HAVE YOUR ASSISTANCE

Поиск
Список
Период
Сортировка
От Gary Chambers
Тема Re: MAY I HAVE YOUR ASSISTANCE
Дата
Msg-id 302670f20809010731gd2d5d64xec8bb212d356a641@mail.gmail.com
обсуждение исходный текст
Ответ на Re: MAY I HAVE YOUR ASSISTANCE  ("D'Arcy J.M. Cain" <darcy@druid.net>)
Ответы Re: MAY I HAVE YOUR ASSISTANCE  ("Fernando Hevia" <fhevia@ip-tel.com.ar>)
Список pgsql-sql
>> I have one problem with the user table. I want to hide the password for the users.

Here's what I did, which requires using the contrib/pgcrypto extension:

CREATE FUNCTION encryptpw() RETURNS TRIGGER AS
$encryptpw$
BEGIN       NEW.password = CRYPT(NEW.password, GEN_SALT('md5'));       RETURN NEW;
END;
$encryptpw$

CREATE TRIGGER trg_encryptpw BEFORE INSERT OR UPDATE ON assignees
FOR EACH ROW EXECUTE PROCEDURE encryptpw();

Comments, suggestions, criticisms?

-- Gary Chambers

/* Nothing fancy and nothing Microsoft! */


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

Предыдущее
От: "D'Arcy J.M. Cain"
Дата:
Сообщение: Re: MAY I HAVE YOUR ASSISTANCE
Следующее
От: "Fernando Hevia"
Дата:
Сообщение: Re: MAY I HAVE YOUR ASSISTANCE