Available to: Developers, Admins
Minimum plan: Free
This page provides a complete reference for all data types supported in TitanRDM column definitions. Each type maps to a PostgreSQL data type in the underlying database.
Text Types
| Type | Description | Length Parameter | Notes |
| varchar | Variable-length character string | Maximum number of characters (e.g., 50, 255) | Most common text type. If length is omitted, defaults to unlimited. |
| character | Fixed-length character string | Exact number of characters | Values are right-padded with spaces to the specified length. Rarely needed — prefer varchar. |
| text | Unlimited-length text | Not applicable | No maximum length. Suitable for descriptions, notes, or large text content. |
When to Use Each
- varchar — the default choice for most text columns (names, codes, descriptions with known max length)
- character — only when values must always be exactly N characters (e.g., ISO country codes are always 2 or 3 characters)
- text — when there is no practical upper bound on length
Integer Types
| Type | Description | Range | Notes |
| smallint | Small-range integer | -32,768 to 32,767 | 2 bytes. Use for small counters or codes. |
| integer | Standard integer | -2,147,483,648 to 2,147,483,647 | 4 bytes. The default choice for whole numbers. |
| bigint | Large-range integer | -9.2 × 10¹⁸ to 9.2 × 10¹⁸ | 8 bytes. Use when values may exceed 2 billion. |
When to Use Each
- integer — the default for most numeric identifiers, counts, and codes
- smallint — when storage efficiency matters and values are known to be small
- bigint — for very large identifiers (e.g., external system IDs that exceed 2 billion)
Decimal / Floating-Point Types
| Type | Description | Length (Precision) | Scale | Notes |
| decimal | Exact numeric with configurable precision | Total number of digits (1–1000) | Number of digits after the decimal point | Exact arithmetic — no rounding errors. Use for financial data. |
| real | Single-precision floating point | Not applicable | Not applicable | 4 bytes, ~6 decimal digits of precision. Subject to rounding. |
| double | Double-precision floating point | Not applicable | Not applicable | 8 bytes, ~15 decimal digits of precision. Subject to rounding. |
Precision and Scale for Decimal
For decimal columns:
- Length = precision = total number of significant digits (both sides of the decimal point)
- Scale = number of digits to the right of the decimal point
Examples:
| Length | Scale | Stores | Example Values |
| 10 | 2 | Up to 99,999,999.99 | 1234.56, 99999999.99 |
| 5 | 3 | Up to 99.999 | 12.345, 0.001 |
| 3 | 0 | Up to 999 (whole numbers only) | 100, 999 |
When to Use Each
- decimal — financial amounts, rates, percentages, or any value where exact arithmetic is required
- real / double — scientific measurements or values where minor rounding is acceptable
Boolean Type
| Type | Description | Valid Values | Notes |
| boolean | True/false value | true, false, null (if not required) | Rendered as a checkbox in the data grid. |
Date and Time Types
| Type | Description | Length Parameter | Format | Notes |
| date | Calendar date (no time) | Not applicable | YYYY-MM-DD | E.g., 2024-03-15 |
| time | Time of day without timezone | Fractional-second precision (0–6) | HH:mm:ss | E.g., 14:30:00 |
| timetz | Time of day with timezone | Fractional-second precision (0–6) | HH:mm:ss±HH:mm | E.g., 14:30:00+10:00 |
| timestamp | Date and time without timezone | Fractional-second precision (0–6) | YYYY-MM-DDTHH:mm:ss | E.g., 2024-03-15T14:30:00 |
| timestamptz | Date and time with timezone | Fractional-second precision (0–6) | YYYY-MM-DDTHH:mm:ss±HH:mm | E.g., 2024-03-15T14:30:00+10:00 |
Fractional-Second Precision
The Length parameter on time/timestamp types controls fractional-second precision:
| Length | Stores | Example |
| 0 | Whole seconds only | 14:30:00 |
| 3 | Milliseconds | 14:30:00.123 |
| 6 | Microseconds (default) | 14:30:00.123456 |
Data Grid Editors
| Type | Editor |
| date | Native browser date picker |
| time, timetz | Native browser time picker |
| timestamp, timestamptz | Native browser datetime-local picker |
When to Use Each
- date — birthdays, effective dates, expiry dates — anything where time is not relevant
- timestamp — event timestamps where timezone context is not needed (or all data is in a single timezone)
- timestamptz — event timestamps in multi-timezone environments (stores in UTC, displays in local time)
- time / timetz — rare in reference data; use for schedule times (e.g., store opening hours)
Binary Type
| Type | Description | Notes |
| binary | Binary data (bytea) | Stores raw bytes. Not editable through the data grid UI. Typically populated via imports or the API. |
Type Selection Guide
| Scenario | Recommended Type |
| Short codes (country, currency, status) | varchar with length |
| Names, labels, titles | varchar with length |
| Long descriptions or notes | text |
| Whole number identifiers | integer |
| Financial amounts | decimal with appropriate precision and scale |
| Yes/no flags | boolean |
| Calendar dates | date |
| Event timestamps | timestamptz |
| Fixed-format codes (always same length) | character with length |
Type Changes After Deployment
When you change a column's data type after the table has been deployed, TitanRDM generates an ALTER TABLE ... ALTER COLUMN ... TYPE statement on the next deployment. The database will attempt to cast existing data to the new type.
Common safe conversions:
- integer → bigint (widening)
- varchar(50) → varchar(100) (lengthening)
- integer → varchar (numbers become strings)
Conversions that may fail:
- varchar → integer (if non-numeric data exists)
- varchar(100) → varchar(50) (if any value exceeds 50 characters)
- timestamp → date (time portion is lost, but does not fail)
Warning: Always review the deployment diff carefully when changing column types on tables that already contain data. A failed type cast will cause the deployment to fail.
Related Pages