Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-15-2005, 01:05 AM   #1
LQ Newbie
Registered: Oct 2005
Location: Pune
Posts: 17

Rep: Reputation: 0
create table in postgres database


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

table name: emp_info




"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,
Old 11-15-2005, 06:52 PM   #2
Registered: Aug 2002
Posts: 14,017

Rep: Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265
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:


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Postgres Database Connection anjani.78 Linux - Software 1 10-07-2005 02:06 AM
changing password for postgres database anjani.78 Linux - Software 1 07-18-2005 10:58 PM
Displaying the table definition on Postgres mkrishnanand Programming 1 08-18-2004 03:51 PM
How to empty database table?? edhan Linux - General 2 10-24-2003 08:53 PM
Connecting a Postgres Database from a Java application Paulo Ges Programming 4 08-23-2003 10:08 AM

All times are GMT -5. The time now is 02:57 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration