Alter Table Change Column Type Postgres Example. The PostgreSQL ALTER TABLE statement provides the action clause that produces a number of options. The RazorSQL alter table tool includes a Change Column Type option for changing the data types of columns on PostgreSQL database tables.
To convert a column to a different data type use a command like. The columns that do not appear in the SET clause retain their original values. Third determine which rows to update in the condition of the WHERE clause.
For example it is possible to add several columns andor alter the type of several columns in a single command.
ALTER TABLE table_name ADD column_name datatype. The RazorSQL alter table tool includes a Change Column Type option for changing the data types of columns on PostgreSQL database tables. Lets take some examples of using the ALTER TABLE RENAME COLUMN. This is particularly useful with large tables since only one pass over the table need be made.