LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices

Reply
 
Thread Tools
Old 11-15-2005, 02:05 AM   #1
kranti
LQ Newbie
 
Registered: Oct 2005
Location: Pune
Posts: 17
Thanked: 0
create table in postgres database


[Log in to get rid of this advertisement]
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
kranti is offline     Reply With Quote
Old 11-15-2005, 07:52 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 8,123
Thanked: 63
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
michaelk is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 03:06 AM
changing password for postgres database anjani.78 Linux - Software 1 07-18-2005 11:58 PM
Displaying the table definition on Postgres mkrishnanand Programming 1 08-18-2004 04:51 PM
How to empty database table?? edhan Linux - General 2 10-24-2003 09:53 PM
Connecting a Postgres Database from a Java application Paulo Góes Programming 4 08-23-2003 11:08 AM


All times are GMT -5. The time now is 01:16 PM.

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