Types
Last updated
Last updated
A column in a SQL database has a defined type, like an integer or a string. Some databases are more strict on types than others. Postgres supports .
Types act as built in to help define the shape of your data. Are you expecting this column to be an integer or will it sometimes have decimal values? Defining the type explains to other database users the shape of the data you expected when you defined the table.
Moreover types act as a way to control the storage footprint of your database. A database must procure the maximum size of the type you define for each row when it stores your data on disk or memory.
Each column in your tables must have a type. You use types when defining tables. You can change the type of a column with ALTER
statements.
When querying tables, the type of the column defines which functions can be used on the data retrieved. To manipulate the type of a column when querying you use the CONVERT()
function.
Doltgres supports , with more being implemented.
A type change in Doltgres is versioned and can cause conflicts when merged. Doltgres can diff across some type changes and will make a best effort to do so.