PostgreSQL ERROR: syntax error at or near “VARCHAR”

In this article, we will see the solution for ERROR: syntax error at or near “VARCHAR”.

PostgreSQL ERROR: syntax error at or near "VARCHAR"

Reolution:

The above error when I have tried to change the column length of varchar(50) to varchar(80) with below command.

alter table emp11 alter column job varchar(80)

Solution: We have to provide TYPE in front of data type like below.

alter table emp11 alter column job type VARCHAR(80);

Error not occurred with the above command.