Below is the query to return day of week from Redshift database. It returns a numeric output . 1 for
Continue readingCategory: Redshift
How to get current timestamp in Redshift database
getdate function can be used to return the current timestamp. select getdate();
Continue readingHow to identify users with superuser access in Redshift database
Use the below sql query to get a list of all superusers in Redshift database. select usename from pg_user_info where
Continue readingHow to list all database users in Redshift
You can query pg_user system catalog table for a list of all the database users in Redshit database. select usename
Continue readingHow to drop a database from redshift cluster
You can drop a database from Redshift cluster using below command where databasename is the name of the database that
Continue readingHow to drop a table in Redshift database
Below is the syntax to drop a table in Redshift database where tablename is the name of the table that
Continue readingHow to list all the users of a group in Redshift database
Use the below sql query to list all the users of a group where groupname is the name of the
Continue readingHow to get current date, day, month, year in Redshift database
Run the below command to get current month from current date in Redshift database. For current date: select CURRENT_DATE; For
Continue readingHow to get yesterday’s date in Redshift database
Use the getdate function to get today’s date. Add or Subtract days as required from today’s date. Example, to get
Continue readingHow to list all objects that are dependent on a table in Redshift
Run the below query to view all the dependent objects of a table in Redshift where schemaname and tablename are
Continue reading