yum install -y unixODBC.x86_64
yum install -y postgresql-odbc.x86_64
vim /etc/odbc.ini
[pg]
Description = Test to pg
Driver = PostgreSQL #与/etc/odbcinst.ini 中一致
Database = postgres
Servername = 192.168.9.139
UserName = admin
Password = admin
Port = 5432
ReadOnly = 0
vim /etc/clickhouse-server/test_dictionary.xml
<dictionaries>
    <dictionary>
        <name>test</name>
        <source>
        <odbc>
                <connection_string>DSN=pg;UID=;PWD=;HOST=;PORT=5432;DATABASE=</connection_string>
                <table>product</table>
            </odbc>
        </source>
        <lifetime>
            <min>300</min>
            <max>360</max>
        </lifetime>
        <layout>
            <hashed/>
        </layout>
        <structure>
            <id>
                <name>id</name>
            </id>
            <attribute>
                <name>del_flag</name>
                <type>UInt64</type>
                <null_value>0</null_value>
            </attribute>
        </structure>
    </dictionary>
</dictionaries>
 
  
  
  
 
 
  
 
 
 