Redpanda SQL vs PostgreSQL
Redpanda SQL aims for close compatibility with PostgreSQL syntax and semantics, yet differs significantly in design and function. Use this page to check which features are supported and where Redpanda SQL diverges from PostgreSQL.
PostgreSQL is an online transactional processing (OLTP) database by default, whereas Redpanda SQL is an online analytical processing (OLAP) query engine. For more on the distinction, see OLTP vs OLAP.
Redpanda SQL doesn’t support common PostgreSQL transaction-processing operations like direct writes or upserts.
Instead, Kafka-compatible producers write topics into Redpanda Streaming. From there, Redpanda SQL queries topics in log form using local or object storage (the "hot" tier), as well as corresponding Apache Iceberg tables in columnar form (the "cold" tier). A single query against a linked Redpanda catalog returns records from both tiers in one result, with no overlap between the live tail and the topic’s history in Iceberg, including records older than your topic retention.
Redpanda SQL is semantically compatible with PostgreSQL but not code compatible. It can’t use common PostgreSQL extensions such as pgvector, PostGIS, or pg_cron.
JSON operators
Redpanda SQL supports operators for handling JSON data in a slightly different way than PostgreSQL.
Equal operator (=)
This operator checks if two JSON values are identical. In Redpanda SQL, two JSON objects are considered equal only when their key-value pairs appear in the exact same order.
SELECT '{"a":1, "b":"c"}'::json = '{"b":"c", "a":1}'::json;
Result:
?column?
----------
f
(1 row)
In PostgreSQL, the = operator is not order-sensitive, so the order of key-value pairs does not affect the comparison result.
Behavioral differences
Error-handling differences
| Function | Input | Output (Redpanda SQL) | Output (PostgreSQL) |
|---|---|---|---|
LN |
|
Infinity |
|
LN |
|
Infinity |
|
LOG10 |
|
NaN |
|
SQRT |
|
input is out of range |
|
SIN |
|
unknown function pi |
working as expected |