Primary & Foreign Keys in pgAdmin

Yes, there is a way to add Primary & Foreign Keys in pgAdmin.

Tested in pgAdmin III Ver.1.16.1 (Windows 7)

  1. Select the table you want
  2. Ctrl+Alt+Enter or right-click / Properties
  3. Select “Constraints” tab
  4. At the left-bottom side of the form you will see the option “Primary Key”
  5. Click add
  6. Select “Columns” tab
  7. Select the column you want as a key
  8. Click add

And you are all set.

You can fill more things if you want, but now you know how to get there.

Leave a Comment