Publications
Page 5 of 7

Altering Published Tables

The ALTER TABLE command allows you to add a column to a table, add a constraint, or drop a constraint. You can use ALTER TABLE even if the table has already been published.

If ALTER TABLE adds a column, and if the column's table was published without a column list, the column automatically appears in the publication. If the table was published with a column list, you will have to drop and re-add the table to the publication using ALTER PUBLICATION if you want to include the new column in the publication.

If ALTER TABLE adds a unique or check constraint, and if all columns mentioned in the constraint are in the publication, the constraint is automatically added to the publication.

If ALTER TABLE drops a unique or check constraint (other than a primary key) that is implicitly published, that constraint is removed from the publication.

ALTER TABLE fails with an error if you attempt to drop:

  • an explicitly published item
  • the primary key of a published table