User guide
// Make a connection using the psqlODBC provider.
OdbcConnection conn = new OdbcConnection(connString);
conn.Open();
// Try a simple query.
string sql = query;
OdbcDataAdapter da = new OdbcDataAdapter(sql, conn);
da.Fill(ds);
dt = ds.Tables[0];
foreach (DataRow row in dt.Rows)
{
Console.WriteLine(row["table_catalog"] + ", " +
row["table_name"]);
}
conn.Close();
Console.ReadKey();
}
catch (Exception ex)
{
Console.Error.WriteLine(ex.Message);
Console.ReadKey();
}
}
}
}
Troubleshooting Connection Issues in Amazon
Redshift
If you have issues with connecting to your cluster from a SQL client tool, there are several things that
you can check to narrow down the problem. If you are using SSL or server certificates, first remove this
complexity while you troubleshoot the connection issue. Then add this back when you have found a
solution. For more information, see Configure Security Options for Connections (p. 158).
The following section has some example error messages and possible solutions for connection issues.
Because different SQL client tools provide different error messages, this is not a complete list, but should
be a good starting point for troubleshooting issues.
Topics
• Connecting from Outside of Amazon EC2—Firewall Timeout Issue (p. 173)
• The Connection Is Refused or Fails (p. 175)
• The Client and Driver Are Incompatible (p. 176)
• Queries Appear to Hang in the Client and Do Not Reach the Cluster (p. 176)
• Queries Appear to Hang in the Client and the Cluster (p. 177)
Connecting from Outside of Amazon EC2—Firewall Timeout
Issue
Example issue:
API Version 2012-12-01
173
Amazon Redshift Management Guide
Troubleshooting Connection Issues in Amazon Redshift