-> To rename already existing table
Syntax:
ALTER TABLE table_name RENAME to new_table_name;
Eg:
Alter table attribute rename to attribute1;
-> To rename a column in table
ALTER TABLE attribute RENAME COLUMN attribute_id TO attr_id;
Rename Table in Postgresql
Related Posts
Vi editor in Linux
Its a visual editor by default installed in every linux system. The next version of vi is vim. The vi editor tool is an interactive tool as it displays changes…
Monitoring in Postgresql
In normal PostgreSQL operation, tuples that are deleted or obsoleted by an update are not physically removed from their table. They remain present until a VACUUM is done. Therefore it’s necessary to do VACUUM periodically, especially…