Error while executing the query ошибка

Published: 13 Nov 2019
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…




Ошибка 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, все читается и редактируется.

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); 

Перейти к контенту

SELECT     
    to_char(messages. TIME, 'YYYY/MM/DD') AS FullDate, 
    to_char(messages. TIME, 'MM/DD') AS PartialDate, 
             COUNT(CASE WHEN message_definitions.error_category = ? THEN 1 END) AS Errors, 
    error_categories.threshold, 
    COUNT(CASE WHEN messages.message_id = 14 THEN 1 END) AS Picks
FROM    
    messages LEFT JOIN
    message_definitions USING (message_id) LEFT JOIN
    error_categories USING (error_category)
WHERE   
    (messages. TIME > TIMESTAMP ? - '30 day'::INTERVAL) AND 
    (messages. TIME < TIMESTAMP '2016-08-03' + '1 day'::INTERVAL) AND 
    (messages.system_id = ?) AND 
    (messages.message_id = 14 OR
     message_definitions.error_category = ?)
GROUP BY 
    FullDate, PartialDate, error_categories.threshold
ORDER BY
    FullDate DESC LIMIT 40

In the above query, In the where clause, (the first line: (messages. TIME > TIMESTAMP ? — ’30 day’::INTERVAL) AND
) when parameter is typecasted (i.e when I put TIMESTAMP before ?) I get the following error

enter image description here

Which is not true for the text data in the second line (messages. TIME < TIMESTAMP ‘2016-08-03’ + ‘1 day’::INTERVAL) AND

When I change the clause to ( messages. TIME > ? ::TIMESTAMP — ’30 day’::INTERVAL) AND
)
( i.e I put the TIMESTAMP after ? )
Can anybody throw some light on what is happening? Thanks!!

Note:
PostGresVersion — 9.6
OdBC driver — 32 bit driver (located at C:Program Files (x86)psqlODBC905binpsqlodbc30a.dll.)
Same is true with Postgres 8.4 as well.

Published: 13 Nov 2019
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…

I also got the same error trying to connect to PostgreSQL via ODBC (using Power BI Desktop September release).

The error I see in trace logs is:

DataMashup.Trace Error: 24579 : {«Start»:»2017-09-29T06:34:57.5573355Z»,»Action»:»Engine/IO/Odbc/Connection/GetInfo32″,»HostProcessId»:»6700″,»InfoType»:»SQL_CONVERT_GUID»,»Exception»:»Exception:rnExceptionType: Microsoft.Mashup.Engine1.Library.Odbc.Interop.OdbcException, Microsoft.MashupEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35rnMessage: ERROR [HYC00] Unrecognized key passed to PGAPI_GetInfo.rnStackTrace:n   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcCachingService.OdbcCachingConnection.OdbcFunctionCaching.GetResult[Output](UInt16 input, Func`3 function)rn   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcTracingService.OdbcTracingConnection.<>c__DisplayClass7.<GetInfoInt32>b__6(IHostTrace trace)rn   at Microsoft.Mashup.Engine1.Library.Common.Tracer.Trace[T](String method, Func`2 func, Boolean hasNoPii)rnrnrn»,»ProductVersion»:»2.50.4859.502 (PBIDesktop)»,»ActivityId»:»1ff501af-0513-4e55-bbfd-e3ba6af3137e»,»Process»:»Microsoft.Mashup.Container.NetFX40″,»Pid»:8836,»Tid»:1,»Duration»:»00:00:00.0037171″}

Hello,

Finally got my report manager up and running as well as all data sources talking nicely thanks to help in another thread.

I’ve got an issue now with setting up a parameterized query to accept input from the user executing the report. There is a field i’d like to be able to select on.

SELECT     SUM(number) AS number1, SUM(number) AS number2, employee, division

FROM         «table»

WHERE     division = @Division

I’d like the user to be able to select the division. I’m running SSRS 2008R2 64 bit on server 2008 64bit.  The datasource is a postgres db.  Upon execution of this in my query builder it does (kind of) prompt for the field but once i input data
it errors out with the following:

TITLE: Microsoft SQL Server Report Designer

——————————

An error occurred while executing the query.

ERROR [42883] ERROR: operator does not exist: @ character varying;

Error while executing the query

——————————

ADDITIONAL INFORMATION:

ERROR [42883] ERROR: operator does not exist: @ character varying;

Error while executing the query (PSQLODBC.DLL)


06.04.2018, 10:51


#3

Цитата Сообщение от Elrmrnt-Kritik
Посмотреть сообщение

Название столбцов и таблиц нужно заключать не в апострофы, а гравис. То есть так должен выглядеть запрос:

Код:

SELECT `id` FROM `users` WHERE `name` = 'Newt_Nelson'

Это, скорее, обратный апостроф, чем гравис :) Они лишь схожи, вроде как, но не являются одним и тем же. Ну не суть.

Выделять столбцы и таблицы обратным апострофом

(мне так привычнее его называть) нужно только тогда, когда имя состоит либо из зарезервированного MySQL слова, либо содержит пробел, либо когда состоит не из латиницы (может ещё какие-то специфические случаи забыл. Можете загуглить). Во всех остальных случаях обратный апостроф не нужен. Так что его запрос лучше сделать таким:

PHP код:


SELECT id FROM users WHERE name 'Newt_Nelson' 


И да, автор. Если что, обратный апостроф ставится нажатием на «ё» с включённой английской раскладкой :)

Связаться со мной в VK можно через личные сообщения этой группы
Заказы не принимаю


Широко известно, что идеи стоят 0.8333 цента каждая (исходя из рыночной цены 10 центов за дюжину).
Великих идей полно, на них нет спроса.
Воплощение идеи в законченную игру требует долгой работы,
таланта, терпения и креативности, не говоря уж о затратах денег, времени и ресурсов.
Предложить идею просто, воплотить – вот в чём проблема


Steve Pavlina


Понравилась статья? Поделить с друзьями:
  • Error status ext ram exception 0xc0050005 ошибка flashtool
  • Error socket hang up postman ошибка
  • Error sending data 12175 произошла ошибка безопасности
  • Error reading from rom ошибка atiwinflash
  • Error reading data 12175 произошла ошибка безопасности faceit