Do not define primary and foreign key constraints in DDL ｗhen creating tables in Amazon Redshift.
Create and use an extract in Tableau.
For more details, refer to Create an extract and Create Extracts on the Web.
Edit the data source, generate and use a custom SQL query in Tableau by converting a Connection to Custom SQL.
For more details, refer to Converting a Connection to Custom SQL.
Set the capability customizations in the Tableau Datasource Customization (TDC) file to prevent Tableau from attempting to read metadata describing primary and foreign key constraints.
For more details, refer to Tableau Capability Customizations Reference.