Unix Technical Forum

Creating users with name and email

This is a discussion on Creating users with name and email within the pgsql Novice forums, part of the PostgreSQL category; --> Normally php programers create a table 'users' with name and password. But the real access will be done allways ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 09:55 PM
Andreas Burkhardt
 
Posts: n/a
Default Creating users with name and email

Normally php programers create a table 'users' with name and password. But
the real access will be done allways with the same (super)user and
password. This is less secure and a bad design, too.

So ich pass the user thru php to the database. But I want to have additional
entrys for my users like the full name und the e-mail address.

How will I handle this the best way in postgresql:

1. adding the new columns to pg_authid?

2. CREATE TABLE users (
email VARCHAR ) INHERITS (pg_authid);

3. CREATE TABLE users (
rolname VARCHAR REFERENCES pg_authid ( rolname ),
email VARCHAR );

4. ???


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 09:55 PM
Tom Lane
 
Posts: n/a
Default Re: Creating users with name and email

Andreas Burkhardt <rootshell@web.de> writes:
> 1. adding the new columns to pg_authid?


> 2. CREATE TABLE users (
> email VARCHAR ) INHERITS (pg_authid);


> 3. CREATE TABLE users (
> rolname VARCHAR REFERENCES pg_authid ( rolname ),
> email VARCHAR );


Actually, none of those will work. You can't modify system catalogs (at
least not without a lot of internals work). You can make a users table
OK, you just can't set up a foreign-key linkage to pg_authid ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:38 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com