Creating tables
Create tables in Baseten Postgres.
On the Data page, click "Add table" in the upper-right corner to launch the table creation screen. Nothing will be created until you actually save the table.
Your table name should be TitleCase with no spaces. Only letters and numbers are allowed, no special characters. If your table is called TableName
in the UI, it will be table_name
when making SQL queries.
The optional description field helps you document the purpose of the table. It is only shown in the UI and does not affect any SQL queries.
Every table has three default columns:
id
, a unique integer identifier for each rowcreated_at
, the datetime at which each row was createdmodified_at
, the datetime at which each row was last updated
These fields cannot be renamed, altered, or deleted, and are present in every Baseten data table.
You can add any number of custom columns to your table to store necessary data. Column names only accept lowercase letters and underscores, such as column_name
.
Columns must have a type. Available types:
string
, a string of effectively unlimited lengthinteger
, an integer between -2,147,483,648 and 2,147,483,647number
, a floating-point value of effectively unlimited sizeboolean
, eitherTrue
orFalse
datetime
, a PostgreSQL datetime objectjson
, a structured object in JSON formobject
, a row of any Baseten data table, including the current onelist
, a list of any of the above types
When you are ready for your table to be created, click "Save table" at the bottom-right corner of the screen. Once you see a toast message confirming the table was created, you can navigate back to the Data page to see it added to the list.
Last updated