Generated stored columns
complete
Kostas Botsas
Support generated columns to be calculated from other columns. PostgreSQL currently implements only stored generated columns.
Example use case for stored generated columns:
ALTER TABLE people ADD height_inches_stored numeric GENERATED ALWAYS AS (height_cm / 2.54) STORED;
Raveen rex
This is just great, Just when I needed it
Kostas Botsas
complete
Xata released Wire protocol access to Postgres as Beta which allows DDL statements including creating Generated columns.
Kostas Botsas
A quick update, we've just released Beta Wire protocol access to Postgres* which allows DDL statements including creating Generated columns.
You can check it out with these resources:
*for new databases, with the Postgres option enabled. Please read the docs on how to enter the Beta and create a new database that uses it.
Alex Francoeur
From a user recently in support of AI generated columns:
In AI, yes I am looking for something like this: There is table with classified data (for example ecommerce categories saved in recursive way), and there is array of strings as unstructured data (unnormalized categories), please map unstructured data to classified data (map unnormalized categories to my categories) and return json with pairs and probability of your decision (for possible access/edit of people).
Gustavo
Idea:
JS-populated columns
. You provide a JS function that takes the record and returns the value for the generated column. The function should be allowed to be async so we could fetch data from other places, including from OpenAI's API for example.Those functions could also be used to overwrite the original column instead of filling a new one. Use case: formatting
JOHN DOE
to John Doe
.Gustavo
Rowy offers something similar: