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(at)mx-deus(dot)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