rename postgres function code example
Example 1: rename table postgres
ALTER TABLE table_name
RENAME TO new_table_name;
Example 2: rename column postgres
ALTER TABLE distributors RENAME COLUMN address TO city;
ALTER TABLE table_name
RENAME TO new_table_name;
ALTER TABLE distributors RENAME COLUMN address TO city;