Last Modified Date: 24 Aug 2022
Issue
The following errors appear when removing a table from the data model canvas followed by adding a new table when connecting Tableau Desktop to Postgresql version 12.
«Unable to connect to the server. Check that the server is running and that you have access privileges to the requested database.»
«Error while executing the query.»
«The table xxxxx does not exist.»
Error message also captured in the attachment «error.PNG».
Environment
- Tableau Desktop 2019.3 and 2019.4
- Windows 10
- PostgreSQL version 12
Resolution
Option 1
Upgrade to Tableau Desktop 2020.4 to connect to PostgreSQL 12 using a JDBC driver that is installed with the product.
Option 2
If you cannot upgrade to Tableau Desktop 2020.4, you can try the steps below:
Uninstall the current Postgresql driver, then install Postgresql ODBC driver version 12.
- The installer can be downloaded from this site https://www.postgresql.org/ftp/odbc/versions/msi/
Once the outdated version of Postgresql ODBC driver has been uninstalled, and the current Postgresql ODBC driver version 12 has been installed, Tableau Desktop will utilize Postgresql ODBC 12 to connect to your Postgresql database version 12.
Cause
There is an incompatibility between the PostgreSQL ODBC 9.x driver, that comes with Tableau Desktop versions prior to 2020.4, and PostgreSQL 12 databases.
Additional Information
Discuss this article…
Last Modified Date: 24 Aug 2022
Issue
When attempting to connect to or refresh a PostgreSQL data source on Tableau Cloud or Tableau Server, or when dragging any measure or dimension to the columns/Rows shelf after the connection is made, the following error may occur:
An error occurred while communicating with PostgreSQL
Bad Connection: Tableau could not connect to the data source
ERROR: current transaction is aborted, commands ignored until end of transaction block; Error while executing the query
Environment
- Tableau Cloud
- Tableau Server
- Tableau Desktop
- PostgreSQL Database 12.1
Resolution
1. Workarounds for scenario 1: When attempting to connect to or refresh a PostgreSQL data source on Tableau Cloud (to track the status of this issue, see Issue ID 947669 on the Known Issues page). This has been resolved with the release of the PostgreSQL JDBC driver to Tableau Cloud.
2. Workaround for scenario 2: when dragging any measure or dimension to the columns/Rows shelf after the connection to PostgreSQL is made.
- Uninstall the current version of the PostgreSQL driver installed on the machine.
- Install the latest version of PostgreSQL driver, version 12.1. Note: the latest Postgres driver can be found here: https://www.postgresql.org/ftp/odbc/versions/msi/
For Tableau Server:
Upgrade to Tableau Server 2020.4 or later, A JDBC driver for PostgreSQL that supports PostgreSQL 12 is installed and used.
Cause
This issue is caused by the PostgreSQL driver. Some PostgreSQL driver versions do not properly handle the cancel request. Because of this, It believes the transaction is still available and attempts to run queries off of it, which causes things to break.
Additional Information
Note: Tableau Cloud has updated all Pods to include the new PostgreSQL JDBC driver for issues with PostgreSQL 12 as of 2/10/21.
You are using different types of quotes together ' with ‘
Replace this:
CREATE TABLE IF NOT EXISTS `users`
(
`id` int(11) NOT NULL auto_increment,
`username` varchar(32) NOT NULL,
`password` varchar(32) NOT NULL,
`online` int(20) NOT NULL default ‘0',
`email` varchar(100) NOT NULL,
`active` int(1) NOT NULL default ‘0',
`rtime` int(20) NOT NULL default ‘0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `users` (`id`, `username`, `password`, `online`, `email`, `active`, `rtime`)
VALUES (1, ‘testing’, ‘testing’, 0, ‘fake@noemail.co.uk’, 0, 0);
With this:
CREATE TABLE IF NOT EXISTS `users`
(
`id` int(11) NOT NULL auto_increment,
`username` varchar(32) NOT NULL,
`password` varchar(32) NOT NULL,
`online` int(20) NOT NULL default '0',
`email` varchar(100) NOT NULL,
`active` int(1) NOT NULL default '0',
`rtime` int(20) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `users` (`id`, `username`, `password`, `online`, `email`, `active`, `rtime`)
VALUES (1, 'testing', 'testing', 0, 'fake@noemail.co.uk', 0, 0);
00000successful_completion01000warning0100Cdynamic_result_sets_returned01008implicit_zero_bit_padding01003null_value_eliminated_in_set_function01007privilege_not_granted01006privilege_not_revoked01004string_data_right_truncation01P01deprecated_feature02000no_data02001no_additional_dynamic_result_sets_returned03000sql_statement_not_yet_complete08000connection_exception08003connection_does_not_exist08006connection_failure08001sqlclient_unable_to_establish_sqlconnection08004sqlserver_rejected_establishment_of_sqlconnection08007transaction_resolution_unknown08P01protocol_violation09000triggered_action_exception0A000feature_not_supported0B000invalid_transaction_initiation0F000locator_exception0F001invalid_locator_specification0L000invalid_grantor0LP01invalid_grant_operation0P000invalid_role_specification0Z000diagnostics_exception0Z002stacked_diagnostics_accessed_without_active_handler20000case_not_found21000cardinality_violation22000data_exception2202Earray_subscript_error22021character_not_in_repertoire22008datetime_field_overflow22012division_by_zero22005error_in_assignment2200Bescape_character_conflict22022indicator_overflow22015interval_field_overflow2201Einvalid_argument_for_logarithm22014invalid_argument_for_ntile_function22016invalid_argument_for_nth_value_function2201Finvalid_argument_for_power_function2201Ginvalid_argument_for_width_bucket_function22018invalid_character_value_for_cast22007invalid_datetime_format22019invalid_escape_character2200Dinvalid_escape_octet22025invalid_escape_sequence22P06nonstandard_use_of_escape_character22010invalid_indicator_parameter_value22023invalid_parameter_value22013invalid_preceding_or_following_size2201Binvalid_regular_expression2201Winvalid_row_count_in_limit_clause2201Xinvalid_row_count_in_result_offset_clause2202Hinvalid_tablesample_argument2202Ginvalid_tablesample_repeat22009invalid_time_zone_displacement_value2200Cinvalid_use_of_escape_character2200Gmost_specific_type_mismatch22004null_value_not_allowed22002null_value_no_indicator_parameter22003numeric_value_out_of_range2200Hsequence_generator_limit_exceeded22026string_data_length_mismatch22001string_data_right_truncation22011substring_error22027trim_error22024unterminated_c_string2200Fzero_length_character_string22P01floating_point_exception22P02invalid_text_representation22P03invalid_binary_representation22P04bad_copy_file_format22P05untranslatable_character2200Lnot_an_xml_document2200Minvalid_xml_document2200Ninvalid_xml_content2200Sinvalid_xml_comment2200Tinvalid_xml_processing_instruction22030duplicate_json_object_key_value22031invalid_argument_for_sql_json_datetime_function22032invalid_json_text22033invalid_sql_json_subscript22034more_than_one_sql_json_item22035no_sql_json_item22036non_numeric_sql_json_item22037non_unique_keys_in_a_json_object22038singleton_sql_json_item_required22039sql_json_array_not_found2203Asql_json_member_not_found2203Bsql_json_number_not_found2203Csql_json_object_not_found2203Dtoo_many_json_array_elements2203Etoo_many_json_object_members2203Fsql_json_scalar_required2203Gsql_json_item_cannot_be_cast_to_target_type23000integrity_constraint_violation23001restrict_violation23502not_null_violation23503foreign_key_violation23505unique_violation23514check_violation23P01exclusion_violation24000invalid_cursor_state25000invalid_transaction_state25001active_sql_transaction25002branch_transaction_already_active25008held_cursor_requires_same_isolation_level25003inappropriate_access_mode_for_branch_transaction25004inappropriate_isolation_level_for_branch_transaction25005no_active_sql_transaction_for_branch_transaction25006read_only_sql_transaction25007schema_and_data_statement_mixing_not_supported25P01no_active_sql_transaction25P02in_failed_sql_transaction25P03idle_in_transaction_session_timeout26000invalid_sql_statement_name27000triggered_data_change_violation28000invalid_authorization_specification28P01invalid_password2B000dependent_privilege_descriptors_still_exist2BP01dependent_objects_still_exist2D000invalid_transaction_termination2F000sql_routine_exception2F005function_executed_no_return_statement2F002modifying_sql_data_not_permitted2F003prohibited_sql_statement_attempted2F004reading_sql_data_not_permitted34000invalid_cursor_name38000external_routine_exception38001containing_sql_not_permitted38002modifying_sql_data_not_permitted38003prohibited_sql_statement_attempted38004reading_sql_data_not_permitted39000external_routine_invocation_exception39001invalid_sqlstate_returned39004null_value_not_allowed39P01trigger_protocol_violated39P02srf_protocol_violated39P03event_trigger_protocol_violated3B000savepoint_exception3B001invalid_savepoint_specification3D000invalid_catalog_name3F000invalid_schema_name40000transaction_rollback40002transaction_integrity_constraint_violation40001serialization_failure40003statement_completion_unknown40P01deadlock_detected42000syntax_error_or_access_rule_violation42601syntax_error42501insufficient_privilege42846cannot_coerce42803grouping_error42P20windowing_error42P19invalid_recursion42830invalid_foreign_key42602invalid_name42622name_too_long42939reserved_name42804datatype_mismatch42P18indeterminate_datatype42P21collation_mismatch42P22indeterminate_collation42809wrong_object_type428C9generated_always42703undefined_column42883undefined_function42P01undefined_table42P02undefined_parameter42704undefined_object42701duplicate_column42P03duplicate_cursor42P04duplicate_database42723duplicate_function42P05duplicate_prepared_statement42P06duplicate_schema42P07duplicate_table42712duplicate_alias42710duplicate_object42702ambiguous_column42725ambiguous_function42P08ambiguous_parameter42P09ambiguous_alias42P10invalid_column_reference42611invalid_column_definition42P11invalid_cursor_definition42P12invalid_database_definition42P13invalid_function_definition42P14invalid_prepared_statement_definition42P15invalid_schema_definition42P16invalid_table_definition42P17invalid_object_definition44000with_check_option_violation53000insufficient_resources53100disk_full53200out_of_memory53300too_many_connections53400configuration_limit_exceeded54000program_limit_exceeded54001statement_too_complex54011too_many_columns54023too_many_arguments55000object_not_in_prerequisite_state55006object_in_use55P02cant_change_runtime_param55P03lock_not_available55P04unsafe_new_enum_value_usage57000operator_intervention57014query_canceled57P01admin_shutdown57P02crash_shutdown57P03cannot_connect_now57P04database_dropped57P05idle_session_timeout58000system_error58030io_error58P01undefined_file58P02duplicate_file72000snapshot_too_oldF0000config_file_errorF0001lock_file_existsHV000fdw_errorHV005fdw_column_name_not_foundHV002fdw_dynamic_parameter_value_neededHV010fdw_function_sequence_errorHV021fdw_inconsistent_descriptor_informationHV024fdw_invalid_attribute_valueHV007fdw_invalid_column_nameHV008fdw_invalid_column_numberHV004fdw_invalid_data_typeHV006fdw_invalid_data_type_descriptorsHV091fdw_invalid_descriptor_field_identifierHV00Bfdw_invalid_handleHV00Cfdw_invalid_option_indexHV00Dfdw_invalid_option_nameHV090fdw_invalid_string_length_or_buffer_lengthHV00Afdw_invalid_string_formatHV009fdw_invalid_use_of_null_pointerHV014fdw_too_many_handlesHV001fdw_out_of_memoryHV00Pfdw_no_schemasHV00Jfdw_option_name_not_foundHV00Kfdw_reply_handleHV00Qfdw_schema_not_foundHV00Rfdw_table_not_foundHV00Lfdw_unable_to_create_executionHV00Mfdw_unable_to_create_replyHV00Nfdw_unable_to_establish_connectionP0000plpgsql_errorP0001raise_exceptionP0002no_data_foundP0003too_many_rowsP0004assert_failureXX000internal_errorXX001data_corruptedXX002index_corruptedОшибка ODBC. SQLSTATE: 42601
Номер ошибки: 1
Описание: ERROR: syntax error at or near «45»;
Error while executing the query
При подключении внешних источников, таблицы все видит, не ругается. А уже в предприятии когда пытаюсь открыть (прочитать) таблицу ругается.
Ранее не раз уже подключал и все работало, исключение что добавился сертификат, но его установил. Может как-то особенно нужно устанавливать?
В строке добавилось только «sslmode=require»
Пример соединения:
«DRIVER={PostgreSQL Unicode}; Data Source=PostgreSQL35W; SERVER=хххххххх; PORT=хххххххх; DATABASE=хххххххх; sslmode=require; UID=хххххххх; PWD=хххххххх»
Подключаюсь с этого ж компьютера при помощи IntelliJ IDEA, все читается и редактируется.
