Database Portability

SQLite vs PostgreSQL Syntax Differences

Apex Forge SQL executes in an in-memory SQLite sandbox. When copying verified queries to production PostgreSQL environments, keep these key dialect differences in mind.

Feature SQLite (Apex Forge Sandbox) PostgreSQL (Production)
Auto-Increment Key INTEGER PRIMARY KEY AUTOINCREMENT SERIAL PRIMARY KEY or IDENTITY
Current UTC Timestamp CURRENT_TIMESTAMP (UTC text string) NOW() or CURRENT_TIMESTAMP
Date Extraction strftime('%Y-%m', date_col) TO_CHAR(date_col, 'YYYY-MM')
String Concatenation col1 || ' ' || col2 CONCAT(col1, ' ', col2) or ||
Boolean Values 0 or 1 (integers) TRUE or FALSE (native boolean)
Pattern Matching LIKE (case-insensitive for ASCII) ILIKE (case-insensitive)

Generate Dialect-Aware Queries

Ask Apex Forge SQL (@English-To-SQL) to append PostgreSQL dialect notes to any generated query.

Open Apex Forge SQL →