🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to PostgreSQL Notes
Topic #9

PostgreSQL ADD COLUMN


The ALTER TABLE Statement

To add a column to an existing table, we have to use the ALTER TABLE statement.

The ALTER TABLE statement is used to add, delete, or modify columns in an existing table.

The ALTER TABLE statement is also used to add and drop various constraints on an existing table.


ADD COLUMN

We want to add a column named color to our cars table.

When adding columns we must also specify the data type of the column. Our color column will be a string, and we specify string types with the VARCHAR keyword. we also want to restrict the number of characters to 255:

Example

ALTER TABLE cars
ADD color VARCHAR(255);

Result

ALTER TABLE

Display Table

To check the result we can display the table with this SQL statement:

Example

SELECT * FROM cars;

As you can see, the cars table now has a color column.

The new column is empty, you will learn how to fill it with values in the next chapter.

Want to go beyond the notes?

Join CodingNow 2.0's PostgreSQL course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

PostgreSQL ADD COLUMN – FAQs

Quick answers about learning PostgreSQL ADD COLUMN in PostgreSQL.

This free note from CodingNow 2.0 explains PostgreSQL ADD COLUMN in PostgreSQL — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every PostgreSQL topic on CodingNow 2.0, including PostgreSQL ADD COLUMN, is 100% free with no signup required.
With focused practice, most students grasp PostgreSQL ADD COLUMN in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now