Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do we get all columns which are the part of sortkey in Redshift

I need to get all columns, which are the part of sortkey in Redshift.

I tried get information using "select * from svv_table_info" but it have only the information of one column only. Can you let me know, how do I get all columns which are the part of Sortkey for a table.

Thanks, Sanjeev

like image 564
Shaun Avatar asked Oct 27 '25 10:10

Shaun


1 Answers

Thanks all for your help. I already tried "pg_table_def" table to get sortkey and distkey information but I have seen only pg_catalog and Public schema, I just go through the Amazon developer guide and found we need to add schema to search path using below commands:- show search_path; set search_path to '$user', 'public', 'NewSchema';

After adding the "NewSchema" in search path I can see sortkey and distkey information for this schema in pg_table_def

Thanks, Sanjeev

like image 190
Shaun Avatar answered Oct 29 '25 05:10

Shaun