SQL reference

Limits and compatibility

Availability boundaries, bounded operations and PostgreSQL client compatibility.

Compatibility boundary

VegaDB speaks the PostgreSQL wire protocol so standard drivers, BI tools and application libraries can connect. It does not claim PostgreSQL server, extension, system-catalog or storage-engine compatibility.

AreaContract
ConnectivityTLS PostgreSQL startup, authentication, simple query and extended query.
Prepared executionParse, bind, describe, execute, portal suspension, close, flush and sync.
ParametersPositional $n parameters with explicit typing for ambiguous or nested values.
TransactionsRead-only READ COMMITTED; no savepoints or two-phase commit.
SQL dialectVegaDB analytical SQL documented in this section.
PostgreSQL extensionsNot loaded through SQL. Use supported VegaDB functions and managed integrations.
PostgreSQL system catalogsDo not depend on undocumented pg_catalog layout. Use information_schema and documented metadata surfaces.
Replication protocolNot exposed by VegaDB warehouse endpoints.
LISTEN/NOTIFY, large objects and PostgreSQL COPY protocolNot supported.

Bounded operations

Limits protect shared service stability and vary by warehouse profile and account policy. The warehouse details and query error return the effective value when a limit is configurable.

ResourceWhat to expect
Query text and expression depthVery large generated statements can be rejected during parsing or binding.
Output rows and bytesInteractive and API clients can have result limits independent of SQL LIMIT.
Runtime and queue timeStatements can expire while queued or executing.
MemoryJoins, sorts, windows, distinct aggregates and nested values are governed by warehouse memory and spill policy.
Recursive CTEsRecursion and retained working state are bounded.
Dynamic PIVOTNumber of generated columns and discovery work are bounded.
Aggregate stateTop-N, exact distinct, lists, histograms and quantiles have state limits.
Nested width/depthContainer depth, array dimensions, field count and encoded value size are bounded.
FederationCatalog calls, object listings, file reads, snapshots and remote retries use service limits and timeouts.

Do not treat a successful small query as evidence that an unbounded production form is safe. Review EXPLAIN, filter early, select only required columns and avoid collecting arbitrarily large lists or JSON values.

Catalog-dependent SQL

The following capabilities depend on the attached catalog and table registration:

  • creating or altering schemas and tables;
  • INSERT, UPDATE, DELETE and MERGE;
  • schema evolution and constraint publication;
  • time-travel selectors and retention;
  • materialized-view destination and refresh behavior.

An unsupported write fails before data is modified. VegaDB does not silently copy an external table into managed storage to make a statement succeed.

Determinism and ordering

SQL tables are unordered. Add ORDER BY whenever result order is contractual. Functions such as first, last, list, string_agg, top-N selection and window navigation need an explicit ordering for repeatable tie behavior.

Floating-point aggregation can vary in the least significant digits when parallel reduction order changes. Use exact decimals for contractual financial results.

Unsupported behavior

Unavailable syntax or an unsupported overload returns an error. It is never delegated to an arbitrary local runtime or accepted with a different meaning. Use the SQLSTATE, structured error fields and the relevant reference page to decide whether to change the query, type, catalog or warehouse configuration.

Version awareness

version() identifies the connected warehouse release. information_schema.routines exposes its function overloads. Production clients should test required language features during deployment and avoid assuming that another workspace or region has already received the same release.

Vegalake, VegaDB and VegaFlow are trademarks or registered trademarks of Vegalake Inc.

On this page