Running Queries

Yellowbrick supports ANSI SQL queries, with support for a large set of SQL functions, including window functions, and pattern matching with POSIX regular expressions. For details, see SQL Functions and Operators. You can also use prepared statements.

Yellowbrick supports the following commands for submitting queries:
  • PREPARE, EXECUTE, DEALLOCATE (prepared statements)

For detailed syntax, see SQL Commands.

Transaction Blocks

You can run queries and other SQL commands within transaction blocks by using standard BEGIN and END statements. You can also create savepoints within transactions and roll back to these savepoints.

By default, when BEGIN and END statements are not used, Yellowbrick executes transactions in "autocommit" mode; each statement is executed in its own transaction and an implicit commit occurs at the end of the statement (assuming that execution was successful).

The only transaction isolation level that Yellowbrick supports is read committed.


Note the following restrictions on Yellowbrick queries:
  • You can run read queries across physical databases, but you cannot write to remote databases. See Cross-Database Queries.
  • You cannot run queries against a mixture of user-defined tables and system tables or views. One exception to this rule is the sys.const table, which can be queried in conjunction with regular tables.
  • You cannot create a table by selecting from PostgreSQL system catalog tables.