Populate a database with username and generate MD5 hash - Mailing list pgsql-novice

From norman
Subject Populate a database with username and generate MD5 hash
Date
Msg-id 149757.48108.qm@web26512.mail.ukl.yahoo.com
Whole thread Raw
List pgsql-novice
Hello,
I would like to implement Mod_Authn_bdb as per example on Apache web site.

http://httpd.apache.org/docs/2.2/mod/mod_authn_dbd.html#example

...

Has anyone implemented this, how do I design my database schema - I have the following:

auth=# \d
         List of relations
 Schema |  Name  | Type  |  Owner
--------+--------+-------+----------
 public | groups | table | postgres
 public | log    | table | postgres
 public | users  | table | postgres
(3 rows)

auth=# \d+ users
                    Table "public.users"
  Column  |         Type          | Modifiers | Description
----------+-----------------------+-----------+-------------
 username | character(32)         |           |
 pass     | text                  |           |
 email    | character varying(80) |           |
Has OIDs: no

auth=# \d+ log
                        Table "public.log"
 Column |              Type              | Modifiers | Description
--------+--------------------------------+-----------+-------------
 uname  | character(20)                  |           |
 time   | timestamp(6) without time zone |           |
 uri    | character varying(512)         |           |
 ip     | inet                           |           |
Has OIDs: no

auth=# \d+ groups
               Table "public.groups"
  Column  |     Type      | Modifiers | Description
----------+---------------+-----------+-------------
 username | character(32) |           |
 memberof | character(64) |           |
Has OIDs: no

Now when I try to log into the protected site, I am presented with the login box. I suppose all is working well.

My question, is there a quick way to load the data of usernames, groups, emails, passwords into postgres and also MD5 the password field?

I have followed setting up http://www.koders.com/noncode/fid54A55F93F75759CC524993DFF82D73300B5EE753.aspx?s=md5

But this is the stage now. I was thinking maybe I can write a script that will load the file as CSV and then MD5 the passwords - has anyone got any advice?

Thanks



For ideas on reducing your carbon footprint visit Yahoo! For Good this month.

pgsql-novice by date:

Previous
From: "G. J. Walsh"
Date:
Subject: Uncertain about recoding prepared statements from MySQL to PostgreSQL
Next
From: norman
Date:
Subject: Re: Graphical tools for PostGres