DatabaseLesson 11Free preview
PostgreSQL ALTER COLUMN
This lesson is part of PostgreSQL · All levels
Summary
ALTER Columns are used to change the definition of an existing column, such as data type, default value, or the need to fill. PostgreSQL even converts values automatically when the length type is compatible. It is important to note that replacing the column name using a separate subcommand, namely RENAME COLUMN.
Key points
- ALTER COLUMN... type changes the data type with conversion when possible.
- SET defaults and DROP defaults set the built-in value of the column.
- SET NOT and DROP NOT set the column content requirement.
- Replace the column name with the ALTER TABLE... rename the column.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.