How to delete/drop a constraint in PostgresSQL

This article will show you how to drop a constraint, such as a foreign key constraint, on a PostgresSQL 8.x database.

  1. Login to the PostgresSQL command-line interface
  2. psql -U [username] [database_name]

  3. Show a list of constraints on a particular table
  4. \d [table_name]

  5. To Delete (or Drop) the constraint, use the command:
  6. ALTER TABLE [table_name] DROP CONSTRAINT [constraint_name];


Please post your comments/suggestions!