How do you rename a column in an existing SQL table?
Instruction: In PostgreSQL, rename the quoted mixed-case column "oldName" to "newName" in products. Explain identifier casing and the deployment checks needed.
Updated
Official answer
In PostgreSQL, if the column was created with the exact quoted mixed-case name oldName, use:
ALTER TABLE products RENAME COLUMN "oldName" TO "newName";
Double quotes preserve the case of these identifiers. Unquoted PostgreSQL identifiers fold to lowercase, so a column originally created as unquoted oldName is actually named oldname and needs the matching spelling. Other engines have different rename syntax and identifier rules.
Renaming changes the column name, not its existing values. Inventory application queries, reports, dynamic SQL and external consumers before rollout; do not assume every dependency is rewritten automatically. Plan locking and migration compatibility for the live workload and verify dependent operations afterward. A reversible database rename alone does not make a coordinated application release risk-free.