A data type specifies what kind of value a column can store. Choosing types is part of defining a table’s schema: for example, a username can be a VARCHAR string, while a creation time can be a timestamp. section 8.2.4 section 8.2.1
CREATE TABLE haikus ( haiku_id SERIAL PRIMARY KEY, created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP, author VARCHAR(100), text TEXT, FOREIGN KEY (author) REFERENCES users(username) );
This table definition uses SERIAL for an auto-incrementing integer, TIMESTAMPTZ for a timestamp with time-zone information, and TEXT for haiku content. section 8.2.4
Types affect how values fit into columns:
- VARCHAR(100) stores strings up to 100 characters; longer values cause an error. section 8.2.4
- TIMESTAMPTZ can use CURRENT_TIMESTAMP as a default when an inserted row omits a value. section 8.2.4
- Pandas uses dtypes such as object and float64; it can also use string[pyarrow] and double[pyarrow]. section 6.2.1

















