Crypt in queries and functions?

Поиск
Список
Период
Сортировка
От Owen Jacobson
Тема Crypt in queries and functions?
Дата
Msg-id 3E388CE0.2020300@mx-deus.net
обсуждение исходный текст
Ответы Re: Crypt in queries and functions?  (Neil Conway <neilc@samurai.com>)
Список pgsql-general
Salve.

I'm writing Yet Another Web Forum and I'm using pgsql as the backend.
I'd like to do user creation and authentication through functions,
rather like:

SELECT Create_User ('Owen', 'password', 'ojacobson@mx-deus.net');

Passwords should, for obvious reasons, be stored encrypted.  I'm
inclined to do this in a unixish way, using crypt().  However, there
doesn't seem to be a crypt function in PostgreSQL's function list.  How
would I go about wrapping or importing the C one?  Is there a better way?

Ideally I'd like to be able to do something like

(table Users has column Password as varchar)

SELECT * FROM Users WHERE crypt('untested password', Password) = Password;

to verify passwords.

Any thoughts?

Owen


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

Предыдущее
От: "Williams, Travis L, NPONS"
Дата:
Сообщение: Re: Perl DBI and placeheld values
Следующее
От: "Matt Block"
Дата:
Сообщение: unsubscribe