Share your knowledge at the LQ Wiki.
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 10-25-2011, 02:26 PM   #1
LQ Newbie
Registered: Feb 2011
Posts: 1

Rep: Reputation: 0
Postgresql and Relationships between tables and Primary keys.


I am coming from microsoft access background, intermediate, and I was totally bowled over by the other threads that are similar to mine.

I definitely would need a more beginners response to my question, that is, if it is reasonable to ask such a thing.

I would like to duplicate a database I just setup in access but now I oould like to do it in Postgresql and I have the following questions:

What is the command I give to create a table with the following structure:
tblClients with ClientID as the primary key and then the usual fields of LastName, FirstName and MI etc.
tblClientLines with a composite primary key of ContractID and ClientID since it has a 1 to many relationship with tblClients and tblContracts.
tblContracts with ContractID as the primary key and AuthCode etc as the other fields.

Thank-you for your time and patience, any pointers or advice would be appreciated.

Old 10-25-2011, 06:19 PM   #2
Registered: Aug 2007
Posts: 133

Rep: Reputation: 16
Seeing as this is a postgreSQL question, you may want to consider finding a postgreSQL forum to ask your question.

That said, I was able to find a lot of information re: migrating many different db types to postgreSQL... See here for starters.


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
Newbie question about PostgreSQL, Schemas & Tables! justemail Linux - Newbie 3 05-27-2009 09:25 AM
(my)sql and composite primary keys kpachopoulos Programming 4 09-18-2007 02:25 AM
LXer: OSCON 2006: TimeTravel Tables in PostgreSQL LXer Syndicated Linux News 0 08-06-2006 10:54 AM
Populating tables in Postgresql rickh Linux - Software 11 03-02-2005 10:34 PM
syncing db tables w/o primary keys linux_terror Linux - Software 3 09-11-2004 12:34 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:27 PM.

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