title: AWS Lambda cannot read a database on AWS Redshift
body: <p>Hi I have a database structure that is like this on redshift:</p>
  <p><a href="https://i.stack.imgur.com/cDHxN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cDHxN.png" alt="enter image description here" /></a></p>
  <p>When I query the vault_control database using the following query, it works on DBeaver:</p>
  <pre><code>select distinct(solution_name) from vault_control;
  </code></pre>
  <p>I get the following results, which is what I want:</p>
  <p><a href="https://i.stack.imgur.com/YcHf3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YcHf3.png" alt="enter image description here" /></a></p>
  <p>However, I have code that is connecting to reshift from lambda via boto3 like this:</p>
  <pre><code>import json
  import boto3
  import time
  
  
  query_string = &quot;select distinct(solution_name) from vault_control;&quot;
  
  def lambda_handler(event, context):
  
      client = boto3.client('redshift-data')
      execution_id = client.execute_statement(
      ClusterIdentifier='id',
      Database='cloudbi',
      DbUser='user',
      Sql=query_string,
       )['Id']
      print(f'Execution started with ID {execution_id}')
  
  
  
  
      status = client.describe_statement(Id=execution_id)['Status']
      while status not in ['FINISHED','ABORTED','FAILED']:
          time.sleep(10)
          status = client.describe_statement(Id=execution_id)['Status']
      print(f'Execution {execution_id} finished with status {status}')
  
  
      if status == 'FINISHED':
          columns = [c['label'] for c in client.get_statement_result(Id=execution_id)['ColumnMetadata']]
          records = client.get_statement_result(Id=execution_id)['Records']
      print(f'SUCCESS. Found {len(records)} records')
  
  else:
      print(f'Failed with Error: {client.describe_statement(Id=execution_id)[&quot;Error&quot;]}')
  </code></pre>
  <p>I am getting an error with :</p>
  <pre><code>Execution f11d86c5-28fd-45d3-a1bf-7b17 finished with status FAILED
  Failed with Error: ERROR: relation &quot;vault_control&quot; does not exist
  </code></pre>
  <p>Can someone please assist?</p>