Alter Column Type
How to change a table column type in PostgresRename A Column
How to rename a table column in PostgresAlter Column Default
How to change a column's default value in PostgresAlter Column Nullable
How to change the nullable flag on a Postgres table columnCREATE INDEX examples
How to create an index on one (or many) columns in Postgres.Alter Table Add Foreign Key
Adding a foreign key (otherwise known as a relation or association) to a Postgres table means adding a 'constraint'. These basic examples assume that the column type is correct, and any existing values match existing relation IDs in the target table.Alter Table Drop Foreign Key / Constraint
Removing a foreign key (otherwise known as a relation or association) from a Postgres table. Note that after removing a relation, you might also want to remove any left over indexes.Alter Table
A Postgres example for changing, adding, and removing columns for an existing table