Does Redshift support any statement equivalent to the following?
DROP TABLE IF EXISTS tablename
This is supported in the latest version of Redshift:
DROP TABLE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
IF EXISTS Clause that indicates that if the specified table doesn’t exist, the command should make no changes and return a message that the table doesn't exist, rather than terminating with an error.
This clause is useful when scripting, so the script doesn’t fail if DROP TABLE runs against a nonexistent table.
Taken from online AWS Redshift docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With