The column type you choose for an attribute — string, integer, boolean, timestamp, or enum — is a permanent product decision disguised as a technical formality. Default to "text" and you inherit dates that won't sort, amounts that won't sum, and statuses that quietly fork into a dozen typo'd variants until someone has to clean it all up.
Quick answer: Match the type to the product intent, not the path of least resistance. A fixed set of choices is an enum, a permanent yes/no is a boolean, a moment in time is a timestamp, a quantity is an integer, and only genuinely free-form human writing is a string. Get it wrong and the bug shows up in a report six months out, not in code review.
Why "Just Make It Text" Is a Product Decision, Not a Shortcut
Defaulting a field to text feels safe because it never rejects an input — but that permissiveness is exactly the bug. A string column can't enforce that status is one of four known values, can't be summed, and can't be sorted chronologically, so validation, arithmetic, and ordering all quietly migrate into scattered application code.
It happens in a spec meeting, not in an engineering review. A PM writes "status: text" in a ticket because typing "text" is faster than deciding on a value list. The engineer implements it as a VARCHAR, ships it, and moves on. Six months later, someone on the growth team tries to filter dashboard data by status and finds Active, active , ACTIVE, and Actve living as four distinct, un-groupable strings in production.
That gap between "looks fine in a demo" and "breaks at scale" is why type decisions belong in the same design pass as your entities and relationships, not as an afterthought engineers fill in silently:
- Free-typed status fields accumulate casing and spelling variants that silently fragment one business concept into a dozen strings.
- Amounts stored as text can't be summed without an explicit, error-prone cast — and that cast fails loudly the first time someone types a currency symbol into the field.
- Dates stored as "July 6, 2026" sort alphabetically, not chronologically, so a "sort by newest" feature breaks the moment two different months appear in the same table.
- Every one of these looks correct with five test rows and breaks with fifty thousand real ones.
This is also why the sequencing matters: you draw the entities and relationships first — the actual structure of the data model, ERD-first — and only then assign a type to each attribute sitting on those entities. Typing is the second, equally consequential design pass, not a substitute for the first.
If you haven't settled what an entity even is in your domain, that decision comes before typing, not after — see what counts as an entity for that groundwork. Bill Kent's 1978 book Data and Reality made the same point long before relational databases were common: a data type is not a storage detail, it's a claim about what a piece of information means and how it's allowed to behave.
For the broader picture of how entities, relationships, and attributes all fit together before you get to individual columns, the complete guide to data modeling is the place to start.
The Five Core Types and the Product Question Each One Answers
Five types cover the overwhelming majority of product attributes, and each one answers a distinct product question rather than a storage question. Borrowing a Jobs to Be Done lens, every attribute on an entity is "hired" to do exactly one job — and the type you assign is a promise about what that job requires.
| Type | Product question it answers | Good example | What breaks if you use text instead |
|---|---|---|---|
| String | What did a person say in their own words? | ticket.description | Nothing — this is the correct default for genuinely free-form input |
| Integer | How many, or a value you'll sum/compare? | invoice.amount_cents, queue.position | Can't SUM(), can't sort numerically, can't validate a range |
| Boolean | Is this a permanent yes/no fact? | user.email_verified | Values drift ("yes"/"true"/"1"/"Y") and a needed third state has nowhere to go |
| Timestamp | When did this moment happen? | subscription.canceled_at | Can't sort chronologically, can't compute durations, timezone bugs |
| Enum | What's the fixed, known set of choices? | order.status | Typos and casing fragment one concept into many distinct strings |
String: the type with no guardrails
A string column accepts anything, which is exactly why it should be reserved for content a human actually composes freely — names, notes, descriptions. The moment you catch yourself writing validation logic around a string column ("must be one of these four values"), that's a signal the attribute was never really a string.
Integer: whole numbers, and money
Counts, ranks, and quantities are the obvious integer cases. Less obvious: money should usually be an integer too — stored as the smallest currency unit (cents), not as a decimal or a float, so arithmetic stays exact.
Boolean: a promise that a third state will never exist
A boolean is a bet that the fact it represents will only ever have two values, forever. is_active looks safe until the product needs pending or suspended, and now engineering is bolting on a second nullable column just to represent a state the original boolean couldn't hold.
Timestamp: a moment, not a label
A timestamp answers "when," and it needs two decisions a plain string can't make for you: date-only vs. date-and-time granularity, and timezone handling. The international ISO 8601 standard — the same format APIs like Stripe's default to in their public documentation — exists precisely because "July 6, 2026, 3pm" is ambiguous the instant your users span more than one timezone.
Whether the moment you're capturing is a signup event, an email open, or a churn date, it's almost always a point on some customer journey you'll eventually want to plot and compare against other timestamps. That comparison is impossible if half your dates are stored as display strings.
Enum: the type that encodes a business rule
An enum is a bet that the list of valid values is fixed, known, and small enough that changing it is rare. That's fine for order.status (pending, shipped, delivered, canceled) — a list the business rarely touches.
It's the wrong bet the moment the list is something a business user, not an engineer, should be able to add to (say, a growing list of lead_source values). At that point the "enum" has quietly become its own entity connected by a one-to-many relationship — a lookup table with an id and a name, not a hardcoded type.
PostgreSQL's own documentation is candid about this: adding a value to a native ENUM type requires an ALTER TYPE statement, and in some versions that change can't run inside the same transaction as other schema work — friction you don't get with a plain lookup table.
The Decision Table: Matching Product Intent to Column Type
Skip the type name entirely and start from what the product actually needs the attribute to do — the correct column type follows directly from that intent, almost every time. Use this table as a first pass in any spec before you hand a field off to engineering.
| Product intent | Example field | Correct type | Why |
|---|---|---|---|
| A fixed set of choices the business controls | order.status | enum, or a lookup table if the list grows often | Small, stable lists validate cheaply; growing lists need a real entity |
| A yes/no fact with no foreseeable third state | user.email_verified | boolean | Anything that might gain a "pending" state isn't really binary |
| A moment in time | subscription.canceled_at | timestamp (with time zone) | Enables sorting, duration math, and correct timezone display |
| A quantity you'll sum, average, or range-filter | invoice.amount_cents | integer (smallest unit) | Exact arithmetic; no float rounding drift |
| A rank, count, or sequence position | queue.position | integer | Needs numeric comparison and ordering |
| A rate or percentage | discount.rate | numeric/decimal | Fixed-precision math, not binary float approximation |
| Free-form text a person writes | ticket.description | string/text | No fixed structure to validate against |
A quick gut check for any attribute you're unsure about: would you ever write a WHERE, GROUP BY, or ORDER BY clause against this column? If yes, it needs a type that supports that operation cleanly — which text almost never does.
Where Loose Typing Breaks in Production: Five Silent Bugs
Loose typing doesn't fail loudly in a pull request; it fails quietly, months later, in a report that looks slightly wrong to someone who can't say why. These five patterns account for most of the "why doesn't this number match" tickets that trace back to a type decision made early and never revisited.
- Unsortable dates. A
signup_datestored as the string "Jul 6, 2026" sorts alphabetically — July comes before January, and the "sort by newest" button silently returns nonsense the moment two different months appear in the list. - Un-summable amounts. An
amountcolumn stored as text ("$1,200.00") can't be passed toSUM()without a regex to strip the currency symbol and commas first — a fragile cast that breaks the first time someone enters a value it didn't anticipate. - Floating-point money drift. Storing money as a
FLOATinstead of an integer or fixed-precision decimal invites rounding error, because the IEEE 754 binary floating-point standard used by virtually every mainstream language cannot represent most decimal fractions exactly. Sum enough transactions and the discrepancy becomes a real, visible accounting mismatch. - Boolean-shaped enums. A field like
is_verifiedworks fine until the product needs apendingstate, and now there's a second nullable boolean bolted on to represent what should have been a three-value enum from day one. - Fragmented free-typed status. Without an enforced value list,
statusaccumulatesActive,active, andACTIVEas three distinct strings, and every downstream filter, report, or dashboard has to special-case all of them or silently undercount.
Industry data backs up how expensive these fixes get once they're live. Redgate's recurring State of Database DevOps research has consistently found that schema-related changes remain one of the slowest, most bottlenecked stages of the release pipeline for a majority of teams surveyed — precisely because changing a column's type after real data has accumulated in it is a migration, not an edit.
Martin Fowler and Pramod Sadalage make the same case in Refactoring Databases: an evolutionary, disciplined approach to schema change exists because the alternative — fixing type mistakes after the fact — routinely means rewriting an entire table, backfilling values, and coordinating a release with zero downtime tolerance.
Specifying Types So Engineering Doesn't Have to Guess
A field spec that names an attribute without naming its type isn't a spec — it's a guess that an engineer will have to resolve alone, usually toward whatever's fastest to implement that day. Closing that gap takes five deliberate steps, not a paragraph of prose in a ticket.
- Name the attribute and the entity it belongs to. If you're not sure whether something is an attribute of an existing entity or deserves to be its own entity, resolve that first — type decisions downstream depend on it.
- State the product intent in one sentence. "This is a fixed set of choices the ops team controls" reads very differently from "this is whatever the customer types into a box."
- Pick the type from the decision table above rather than defaulting to whatever was used on the last field you specified.
- Write the constraint next to the type — required or nullable, a default value, a max length, or the allowed value list for an enum.
- Show an example value, not just the field name. "
status: text" invites a guess; "status: one ofpending,shipped,delivered,canceled, defaultpending" doesn't.
This is exactly the gap Prodinja's Data Modelling studio is built to close. You assign a concrete type to every attribute on an entity — string, integer, boolean, timestamp, enum, or a foreign key to another entity — and the tool renders the corresponding SQL DDL alongside it in real time.
A loose "status: text" decision shows its actual CREATE TABLE column definition — a bare VARCHAR, versus an ENUM, versus a foreign key to a lookup table — before an engineer ever inherits the ticket and has to guess what you meant.
Key Takeaways
- The column type you assign to an attribute is a product rule enforced by the database, not a formatting preference — treat it with the same weight as an entity or relationship decision.
- String/text is not a safe default. It's the type with no guardrails, and it should be reserved for genuinely free-form input a person writes.
- A boolean is a promise that no third state will ever be needed; break that promise later and you get a bolted-on nullable hack instead of a clean enum.
- Timestamps need an explicit decision about date-only vs. date-and-time granularity and timezone handling — don't let a string masquerade as a date.
- Enums are cheap for small, stable, engineer-owned lists and expensive to change once real data has accumulated; once the list is business-owned and growing, it's a lookup table (a real entity), not a hardcoded type.
- Specify the type, the constraint, and an example value in every engineering handoff — not just the field name — so nobody has to guess.
- Tools like Prodinja's Data Modelling studio can show the actual generated DDL a type decision produces, before it ships, so a loose "text field" call is visible while it's still cheap to fix.
Frequently Asked Questions
Should I use a string or an enum for a status field?
Use an enum (or a foreign key to a lookup table) whenever the field has a fixed, known set of valid values that the product controls — order status, subscription state, approval stage. Reserve string columns for values a person types freely, like a support ticket description, where there's no fixed list to validate against.
What data type should I use for a date that also needs a time?
Use a timestamp with time zone, not a plain date or a string. A date-only column is correct for something like a birthday, where the time of day is irrelevant, but any event tied to a specific moment — a payment, a cancellation, a login — needs the full timestamp so it can be sorted, compared, and displayed correctly across timezones.
Why shouldn't I store money as a float?
Because the IEEE 754 binary floating-point standard, used by virtually every mainstream programming language, can't represent most decimal fractions exactly, so summing many float amounts drifts by fractions of a cent that eventually surface as a real, visible accounting discrepancy. Store money as an integer count of the smallest currency unit (cents) or a fixed-precision decimal type instead.
When should a boolean become an enum instead?
The moment a yes/no fact might ever need a third state — pending, unknown, not-applicable — it was never really a boolean; it was an enum that happened to only have two values so far. If you can imagine a product conversation that starts with "well, actually, sometimes it's neither," specify an enum from the start rather than retrofitting one later.
Is VARCHAR(255) still a reasonable default for text fields?
Usually not. Modern PostgreSQL documentation itself notes there's little performance benefit to an arbitrary length cap like VARCHAR(255) over unbounded text, unless the product has a genuine hard limit (a two-letter country code, for instance). An arbitrary cap without a real product reason is a leftover convention, not a deliberate type decision.