Skip to content

aws.redshift_data.describe_table

Example SQL Queries

SELECT * FROM
aws.redshift_data.describe_table
WHERE
"database" = 'VALUE';

Description

Describes the detailed information about a table from metadata in the cluster. The information includes its columns. A token is returned to page through the column list. Depending on the authorization method, use one of the following combinations of request parameters:

  • Secrets Manager - when connecting to a cluster, provide the secret-arn of a secret stored in Secrets Manager which has username and password. The specified secret contains credentials to connect to the database you specify. When you are connecting to a cluster, you also supply the database name, If you provide a cluster identifier (dbClusterIdentifier), it must match the cluster identifier stored in the secret. When you are connecting to a serverless workgroup, you also supply the database name.

  • Temporary credentials - when connecting to your data warehouse, choose one of the following options:

    • When connecting to a serverless workgroup, specify the workgroup name and database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift-serverless:GetCredentials operation is required.

    • When connecting to a cluster as an IAM identity, specify the cluster identifier and the database name. The database user name is derived from the IAM identity. For example, arn:iam::123456789012:user:foo has the database user name IAM:foo. Also, permission to call the redshift:GetClusterCredentialsWithIAM operation is required.

    • When connecting to a cluster as a database user, specify the cluster identifier, the database name, and the database user name. Also, permission to call the redshift:GetClusterCredentials operation is required.

For more information about the Amazon Redshift Data API and CLI usage examples, see Using the Amazon Redshift Data API in the Amazon Redshift Management Guide.

Table Definition

Column NameColumn Data Type
database Required Input Column

The name of the database that contains the tables to be described. If ConnectedDatabase is not specified, this is also the database to connect to with your authentication credentials.

VARCHAR
cluster_identifier Input Column

The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.

VARCHAR
connected_database Input Column

A database name. The connected database is specified when you connect with your authentication credentials.

VARCHAR
db_user Input Column

The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.

VARCHAR
schema Input Column

The schema that contains the table. If no schema is specified, then matching tables for all schemas are returned.

VARCHAR
secret_arn Input Column

The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.

VARCHAR
table Input Column

The table name. If no table is specified, then all tables for all matching schemas are returned. If no table and no schema is specified, then all tables for all schemas in the database are returned

VARCHAR
workgroup_name Input Column

The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

column_list

A list of columns in the table.

STRUCT(
"column_default" VARCHAR,
"is_case_sensitive" BOOLEAN,
"is_currency" BOOLEAN,
"is_signed" BOOLEAN,
"label" VARCHAR,
"length" BIGINT,
"name" VARCHAR,
"nullable" BIGINT,
"precision" BIGINT,
"scale" BIGINT,
"schema_name" VARCHAR,
"table_name" VARCHAR,
"type_name" VARCHAR
)[]
Show child fields
column_list[]
Show child fields
column_list[].column_default

The default value of the column.

column_list[].is_case_sensitive

A value that indicates whether the column is case-sensitive.

column_list[].is_currency

A value that indicates whether the column contains currency values.

column_list[].is_signed

A value that indicates whether an integer column is signed.

column_list[].label

The label for the column.

column_list[].length

The length of the column.

column_list[].name

The name of the column.

column_list[].nullable

A value that indicates whether the column is nullable.

column_list[].precision

The precision value of a decimal number column.

column_list[].scale

The scale value of a decimal number column.

column_list[].schema_name

The name of the schema that contains the table that includes the column.

column_list[].table_name

The name of the table that includes the column.

column_list[].type_name

The database-specific data type of the column.

table_name

The table name.

VARCHAR