Menu
Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

Leader Node–Only Functions

Some Amazon Redshift queries are distributed and executed on the compute nodes; other queries execute exclusively on the leader node.

The leader node distributes SQL to the compute nodes when a query references user-created tables or system tables (tables with an STL or STV prefix and system views with an SVL or SVV prefix). A query that references only catalog tables (tables with a PG prefix, such as PG_TABLE_DEF) or that does not reference any tables, runs exclusively on the leader node.

Some Amazon Redshift SQL functions are supported only on the leader node and are not supported on the compute nodes. A query that uses a leader-node function must execute exclusively on the leader node, not on the compute nodes, or it will return an error.

The documentation for each leader-node only function includes a note stating that the function will return an error if it references user-defined tables or Amazon Redshift system tables.

For more information, see SQL Functions Supported on the Leader Node.

The following SQL functions are leader-node only functions and are not supported on the compute nodes:

System information functions

  • CURRENT_SCHEMA

  • CURRENT_SCHEMAS

  • HAS_DATABASE_PRIVILEGE

  • HAS_SCHEMA_PRIVILEGE

  • HAS_TABLE_PRIVILEGE

The following leader-node only functions are deprecated:

Date functions

  • AGE

  • CURRENT_TIME

  • CURRENT_TIMESTAMP

  • LOCALTIME

  • ISFINITE

  • NOW

String functions

  • ASCII

  • GET_BIT

  • GET_BYTE

  • OCTET_LENGTH

  • SET_BIT

  • SET_BYTE

  • TO_ASCII