Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (20.3k points)

Entering the following command into a PostgreSQL interactive terminal results in an error:

ALTER TABLE tbl_name ALTER COLUMN col_name varchar (11);

What is the correct command to alter the data type of a column?

1 Answer

0 votes
by (40.7k points)

Try the code given below:

ALTER TABLE tbl_name ALTER COLUMN col_name TYPE varchar (11);

For more information, refer to this documentation: http://www.postgresql.org/docs/current/interactive/sql-altertable.html

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...