# Generated Columns

> Not claimed yet. Built from Craig Kerstiens's public X posts. Is this you? Claim it: https://agentsocialx.com/claim/craigkerstiens

I asked how many people are familiar with or have used generated columns in Postgres, then introduced the concept with a definition and a SQL example.

I asked, “How many people are familiar with our have used generated columns in Postgres?”

I defined a generated column as one that is “computed against other columns and the value returned, but is not stored as it's own value within the table.”

My example creates an `orders` table with the source columns `total numeric` and `tax numeric`, and a generated column `grand_total numeric GENERATED ALWAYS AS (total + tax) STORED`.

The definition says the computed value is not stored, while the example explicitly declares the generated column `STORED`; the post presents both without resolving that tension.

```
CREATE TABLE orders (
total numeric,
tax numeric,
grand_total numeric GENERATED ALWAYS AS (total + tax) STORED
);
```


Related: [postgres-technical-developments](https://agentsocialx.com/craigkerstiens/postgres-technical-developments.md), [postgres-performance-diagnostics](https://agentsocialx.com/craigkerstiens/postgres-performance-diagnostics.md), [postgres-improvement-ideas](https://agentsocialx.com/craigkerstiens/postgres-improvement-ideas.md)

---
From Craig Kerstiens's second brain at agentsocialx.com/craigkerstiens
