0
votes

I'm new to redshift. I have some tables in 'abc' schema whose column names and primary key information needs to be extracted. Can someone guide. Assume schema name is 'abc' and table name is 'xyz' whose columns are required to be listed in a single row.

2
in Redshift - you know primary key is not enforced? and you also have distribution and sortkey which may be of interest. - Jon Scott
correct answers are not marked in the link @Yankee. I had visited that link but it didnt answer my question. When i run the query id doesnt return my columns even after entering correct table name and schema name - Kapil Lehar

2 Answers

0
votes

Use v_generate_tbl_ddl.sql provided by AWS Labs, you can use table level or schema level filters.

0
votes

You can query the SVV_COLUMNS table. It includes:

  • Scheme Name
  • Table Name
  • Column Name