how to change column name in postgres sql code example
Example 1: how to update column name in psql
ALTER TABLE table_name
RENAME COLUMN old_name TO new_name;
Example 2: rename column postgres
ALTER TABLE customers
RENAME COLUMN name TO customer_name;
ALTER TABLE customers
RENAME COLUMN phone TO contact_phone;
Example 3: rename column postgres
ALTER TABLE distributors RENAME COLUMN address TO city;
Example 4: how to update column name in psql
ALTER TABLE order_details
DROP COLUMN notes;