View a markdown version of this page

SHOW CREATE SCALEOUT TABLE - Amazon Aurora

SHOW CREATE SCALEOUT TABLE

Use SHOW CREATE SCALEOUT TABLE to read back the definition of a scaleout table in a database cluster group for Aurora.

Description and syntax

Returns the full definition of one scaleout table. On Aurora MySQL, the result has the columns Scaleout Table and Create Scaleout Table. The routing layer has no system table that lists scaleout tables, so this statement is the way to read a definition back.

SHOW CREATE SCALEOUT TABLE table_name;

Parameters and options

The statement takes the following parameter.

table_name

The scaleout table to show. On Aurora MySQL, you can qualify it with a database, or select the database first with USE.

Where it runs and required privileges

Run the statement at the routing endpoint, in a session that isn't pinned. A pinned session passes the statement through to the member cluster unchanged. For the details, see Where these statements run.

For the privilege that the statement needs, see Privileges.

Usage notes

Keep the following in mind when you use the statement.

  • Read each definition back by name, and keep a copy with your export of the data mappings. To find the names, run SHOW SCALEOUT TABLES, or keep your own list.

  • DESCRIBE SCALEOUT TABLE isn't supported. Use this statement instead.

  • On Aurora MySQL, DESCRIBE and SHOW COLUMNS of a scaleout table return error 1146 unless you set scaleout_tables_preferred_member, which names the member table that answers them.

Examples

The following example shows the definition of orders on Aurora MySQL, after it selects the database db.

USE db; SHOW CREATE SCALEOUT TABLE orders;

Errors

The statement can return the following errors. For all errors from the routing layer, see Error codes for database cluster groups for Aurora.

Aurora MySQL Meaning
1064 Syntax error, such as DESCRIBE SCALEOUT TABLE.
1146 Table '<db>.<table>' doesn't exist DESCRIBE or SHOW COLUMNS of a scaleout table with no preferred member table. Use SHOW CREATE SCALEOUT TABLE, or set a preferred member table.

For more information, see the following: