Skip to content

AWS bytes

  • Cheat Sheets
  • Concepts
    • Show All
    • S3 Concepts
  • How-To Guides
    • Show all
    • EC2
    • EBS
    • S3
    • Redshift
    • IAM
    • SQS
    • CloudWatch
    • Billing
  • CLI Guides
  • Contact Us
  • Tutorials
  • Interview Questions
  • Postgresql

Category: How-To Guides

How-To Guides / Redshift

How to get the ddl of a view in Redshift database

DDL of views can be obtained from information_schema.views. Below is the sql to get the view definition where schemaname is

Continue reading
How-To Guides / Redshift

How to list all views in a Redshift database

Run the below query to list all the non-system views in a Redshift database. select table_schema, table_name from information_schema.views where

Continue reading
How-To Guides / Redshift

How to add multiple columns to a table in Redshift

Below is the syntax to add a new column to an existing table in Redshift. alter table schemaname.tablename add columnname

Continue reading
How-To Guides / Redshift

How to view the sql history(recent queries) of a user in Redshift

Use the below sql statement to view the recent 100 queries run by a user ordered by the most recent

Continue reading
How-To Guides / Redshift

How to resolve ‘ALTER TABLE ALTER COLUMN cannot run inside a transaction block’ in Redshift

You might encounter the below error while trying to modify a column in Redshift database from SQL Workbench. [Amazon](500310) Invalid

Continue reading
How-To Guides / Redshift

How to change the distribution style of a table in Redshift database

You can modify the distribution style of a table using below sql command: alter table tablename alter diststyle AUTO|ALL|EVEN|KEY DISTKEY

Continue reading
How-To Guides / Redshift

How to determine the distribution style of a table in Redshift database

You can query the SVV_TABLE_INFO view to determine the distribution style of a table. select “database”, “schema”, “table”, “diststyle” from

Continue reading
How-To Guides / Redshift

How to query only the top 10 rows in Redshift

Use the Top function to query only the top 10 rows. Syntax is as below: Select top 10 * from

Continue reading
How-To Guides / IAM

How to deactivate the MFA device of an IAM user

Run the below command to deactivate the MFA device defined for an IAM user where username is the name of

Continue reading
How-To Guides / IAM

How to get information about an IAM role

Use the below command to view all the information of an IAM role where ROLENAME is the name of the

Continue reading

Posts pagination

«Previous Posts 1 … 5 6 7 8 9 … 22 Next Posts»
  • PostgreSQL Tutorials
  • Redshift Tutorials
WordPress Theme: Maxwell by ThemeZee.