DROP DATASHARE - Amazon Redshift
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

DROP DATASHARE

Drops a datashare. This command isn't reversible.

Only a superuser or the datashare owner can drop a datashare.

Required privileges

Following are required privileges for DROP DATASHARE:

  • Superuser

  • Users with the DROP DATASHARE privilege

  • Datashare owner

Syntax

DROP DATASHARE datashare_name;

Parameters

datashare_name

The name of the datashare to be dropped.

DROP DATASHARE usage notes

When using the DROP DATASHARE statement, consider the following:

  • In general, we recommend that you don't drop an Amazon Web Services Data Exchange datashare using the DROP DATASHARE statement. If you do, the Amazon Web Services accounts that have access to the datashare lose access. Performing this type of alteration can breach data product terms in Amazon Web Services Data Exchange.

    The following example shows an error when an Amazon Web Services Data Exchange datashare is dropped.

    DROP DATASHARE salesshare; ERROR: Drop of ADX-managed datashare salesshare requires session variable datashare_break_glass_session_var to be set to value '620c871f890c49'

    To allow dropping an Amazon Web Services Data Exchange datashare, set the following variable and run the DROP DATASHARE statement again.

    SET datashare_break_glass_session_var to '620c871f890c49';
    DROP DATASHARE salesshare;

    In this case, Amazon Redshift generates a random one-time value to set the session variable to allow DROP DATASHARE for an Amazon Web Services Data Exchange datashare.

Examples

The following example drops a datashare named salesshare.

DROP DATASHARE salesshare;