How to Rename a Table in PostgreSQL

Last updated July 24, 2026 · By the SaturnSQL team

Use ALTER TABLE ... RENAME TO. Postgres updates views, foreign keys, and sequences that reference the table automatically, but application queries using the old name will break.

ALTER TABLE orders RENAME TO customer_orders;

Move to another schema

ALTER TABLE public.orders SET SCHEMA archive;

Run this in SaturnSQL

SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.

Try it free

Related PostgreSQL guides

© 2026 Panda Capital Oy Ab. All rights reserved.