Tableau | What is the error "Prepared statement already exists"?
Users of Tableau Desktop on Mac devices may run into an error much like the following when querying data from ChannelMix/Amazon Redshift:
“ERROR: prepared statement "_PLAN0x7fa52e002200" already exists; Error while preparing parameters”
This error can be resolved through the following steps:
Step 1 - Close all open Tableau Desktop windows
Step 2 - Remove Redshift drivers
Hit the finder icon in the top right corner and enter /opt/amazon. Click enter, then drag the Amazon folder to the trash.
Step 3 - Re-install Redshift drivers
Download and install via the following link:
Step 4 - Place TDC files in Tableau Repository
Download and place the redshift_support.tdc file and >postgres.tdc provided in your Documents/My Tableau Repository/Datasources folder.
Step 5 - Download and configure the iODBC Administrator
Download and install via the following link:
http://www.iodbc.org/dataspace/doc/iodbc/wiki/iodbcWiki/Downloads
After installing, open the iODBC Administrator application. Click over to the ‘ODBC Drivers’ tab.
If ‘Amazon Redshift’ is not in the list, click ‘Add a Driver’. Next to ‘Description of the Driver’, type ‘Amazon Redshift’, and next to ‘Driver file name’, copy and paste the director in which the driver is located: /opt/amazon/redshift/lib/universal/libamazonredshiftodbc.dylib and click OK.
If ‘Amazon Redshift’ is already in the list, click ‘Configure’. Next to ‘Driver file name’, copy and paste the directory in which the driver is located: ` and click OK.
Click ‘OK’ once more to close iODBC administrator.
Step 6 - Open Tableau and connect to Amazon Redshift
Make sure you’ve opened Tableau Desktop 2019.2.1.
Open a Tableau workbook and navigate to the ‘Data Source’ menu or create a new connection to redshift. When the redshift connection window appears, enter your credentials. Create a new extract or refresh your existing extracts.