PostgreSQL: Change column casting type to another type

Because there have been a few times that I have needed to adjust a column in PostgreSQL from one type of casting to another I am going to put it here so I can find it again and for anyone else that may be looking to do the same thing.

ALTER TABLE table_name ALTER COLUMN column_name TYPE INTEGER USING column_name::INTEGER

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.