-2

Is a primary key field NOT NULL by default in postgres, or does it need to be specified as such when creating the table?

Andrew Einhorn
  • 741
  • 8
  • 23

1 Answers1

14

Quote from the manual

Adding a primary key will automatically create a unique B-tree index on the column or group of columns listed in the primary key, and will force the column(s) to be marked NOT NULL.

(emphasis mine)