Benefit of TEXT with CHECK over VARCHAR(X) in PostgreSQL. Brandur suggests using email TEXT CHECK (char_length(email) <= 255)
to define a column with a length limit in PostgreSQL over VARCHAR(255)
because TEXT
and VARCHAR
are equally performant but a CHECK
length can be changed later on without locking the table, whereas a VARCHAR
requires an ALTER TABLE
with an exclusive lock.
Recent articles
- Gemini 2.0 Flash: An outstanding multi-modal LLM with a sci-fi streaming mode - 11th December 2024
- ChatGPT Canvas can make API requests now, but it's complicated - 10th December 2024
- I can now run a GPT-4 class model on my laptop - 9th December 2024