LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   create table in postgres database (https://www.linuxquestions.org/questions/linux-newbie-8/create-table-in-postgres-database-383244/)

kranti 11-15-2005 01:05 AM

create table in postgres database
 
Hi,

I want to create a table in postgres database with following format...

table name: emp_info

columns

id
name
address
email
phoneno

indexes:

"emp_info_id_key" unique, btree (id, address)
"emp_info_name_key" unique, btree(name, address)

Theoretically, it is not possible to create multiple primary keys for a table. Hence I'm not able to create this type of table. Is any thing other than primary key is required to create such a table?

Thanks in advance,
Kranti

michaelk 11-15-2005 06:52 PM

True that you can only have on primary key but you can create multiple indexes. I do not think your emp_info_name_key index can be defined as unique. However, I do not claim to be a database expert and I am not sure on what you are trying to accomplish so have a go here:
http://www.postgresql.org/docs/8.1/i...e/indexes.html


All times are GMT -5. The time now is 08:07 AM.