Hello. Thanks for great DBMS. I have a problem: I'm trying to set up external dictionaries for PostgreSQL 10.1 on Debian 9 using Clickhouse 18.10.3.
But got an error during dictionary data querying with Sql command
SELECT dictGetString('accounts_pg_dict', 'login', toUInt64(1)) FROM system.one:
Poco Exception. Code: 1000, e.code() = 0, e.displayText() = Connection attempt failed: Connection:Not applicable
Server:gameserver-private
ODBC Diagnostic record 1
SQLSTATE = 08001
Native Error Code = 101
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
, e.what() = Connection attempt failed
Here is my config files:
cat /etc/odbc.ini
[DEFAULT]
Driver = gameserver-private
[gameserver-private]
Description = PostgreSQL connection to gameserver-private
Driver = PostgreSQL Unicode
Servername = 192.168.1.1
Database = gameserver-private
UserName = ***
Password = ***
Port = 5432
Protocol = 10.1
ReadOnly = No
RowVersioning = No
ShowSystemTables = No
ConnSettings =
cat /etc/odbcinst.ini
[PostgreSQL ANSI]
Description=PostgreSQL ODBC driver (ANSI version)
Driver=/usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so
Setup=libodbcpsqlS.so
Debug=0
CommLog=1
UsageCount=1
[PostgreSQL Unicode]
Description=PostgreSQL ODBC driver (Unicode version)
Driver=/usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so
Setup=libodbcpsqlS.so
Debug=0
CommLog=1
UsageCount=1
cat /etc/clickhouse_substitutions.xml
<yandex>
<gameserver_connection_string>DSN=gameserver-private;UID=***;PWD=***;HOST=192.168.1.1;PORT=5432;DATABASE=gameserver-private</gameserver_connection_string>
</yandex>
cat /etc/clickhouse-server/gameserver_dictionary.xml
<yandex>
<include_from>/etc/clickhouse_substitutions.xml</include_from>
<dictionary>
<name>accounts_pg_dict</name>
<source>
<odbc>
<connection_string incl="gameserver_connection_string"/>
<table>accounts.accounts</table>
</odbc>
</source>
<lifetime>
<min>300</min>
<max>450</max>
</lifetime>
<layout>
<hashed/>
</layout>
<structure>
<id>
<name>id</name>
</id>
<attribute>
<name>login</name>
<type>String</type>
<null_value>''</null_value>
</attribute>
<attribute>
<name>is_developer</name>
<type>UInt8</type>
<null_value>0</null_value>
</attribute>
<attribute>
<name>is_bot</name>
<type>UInt8</type>
<null_value>0</null_value>
</attribute>
<attribute>
<name>created_at</name>
<type>DateTime</type>
<null_value>toDateTime('0000-00-00 00:00:00')</null_value>
</attribute>
</structure>
</dictionary>
</yandex>
Also strange thing that I can query data via odbc with command from Clickhouse machine:
echo "select * from accounts.accounts LIMIT 10"| iusql gameserver-private -b
I have PostgreSQL and Clickhouse on different machines, why I get such an error? What am I doing wrong? :)
ΠΠΎΠΏΡΠ°Π²ΠΈΠ»ΠΈ.
ΠΡΠΈΠ±ΠΊΠ° Π±ΡΠ»Π° Π² ΡΠΎΠΌ, ΡΡΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π»ΠΈ "-" Π² ΡΠ°ΠΉΠ»Π΅ odbc.ini, Π² Π½Π°Π·Π²Π°Π½ΠΈΠΈ: gameserver-private.
ΠΠ°ΠΌΠ΅Π½ΠΈΠ»ΠΈ Π½Π° gameserverprivate ΠΈ Π²ΡΡ Π·Π°ΡΠ°Π±ΠΎΡΠ°Π»ΠΎ.
ΠΡΠΈΠ±ΠΊΠ° ΠΊΠΎΡΠΎΡΡΡ ΠΏΠΎΠ»ΡΡΠ°Π»ΠΈ Π² ΠΈΡΠΎΠ³Π΅ ΠΎΡΠ΅Π½Ρ Π·Π°ΠΏΡΡΡΠ²Π°Π»Π°, ΡΠΎΠ»ΡΠΊΠΎ Π°Π΄ΠΌΠΈΠ½ ΡΠΌΠΎΠ³ Π·Π°ΠΏΠΎΠ΄ΠΎΠ·ΡΠΈΡΡ Π½Π΅Π»Π°Π΄Π½ΠΎΠ΅ Π² ΡΠΈΠΌΠ²ΠΎΠ»Π΅ "-".
Most helpful comment
ΠΠΎΠΏΡΠ°Π²ΠΈΠ»ΠΈ.
ΠΡΠΈΠ±ΠΊΠ° Π±ΡΠ»Π° Π² ΡΠΎΠΌ, ΡΡΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π»ΠΈ "-" Π² ΡΠ°ΠΉΠ»Π΅ odbc.ini, Π² Π½Π°Π·Π²Π°Π½ΠΈΠΈ: gameserver-private.
ΠΠ°ΠΌΠ΅Π½ΠΈΠ»ΠΈ Π½Π° gameserverprivate ΠΈ Π²ΡΡ Π·Π°ΡΠ°Π±ΠΎΡΠ°Π»ΠΎ.
ΠΡΠΈΠ±ΠΊΠ° ΠΊΠΎΡΠΎΡΡΡ ΠΏΠΎΠ»ΡΡΠ°Π»ΠΈ Π² ΠΈΡΠΎΠ³Π΅ ΠΎΡΠ΅Π½Ρ Π·Π°ΠΏΡΡΡΠ²Π°Π»Π°, ΡΠΎΠ»ΡΠΊΠΎ Π°Π΄ΠΌΠΈΠ½ ΡΠΌΠΎΠ³ Π·Π°ΠΏΠΎΠ΄ΠΎΠ·ΡΠΈΡΡ Π½Π΅Π»Π°Π΄Π½ΠΎΠ΅ Π² ΡΠΈΠΌΠ²ΠΎΠ»Π΅ "-".