2 PostgreSQL数据库推荐的UnixODBC设置

    安装

    • Red Hat Enterprise Linux/CentOS:
    • Debian/Ubuntu:

    请参阅 为相应的平台下载必要的数据库驱动程序。

    配置

    通过编辑 odbcinst.iniodbc.ini 文件来完成ODBC的配置。这些配置文件可以在 /etc 文件夹中找到。odbcinst.ini 文件可能不存在,这时我们需要手动来创建它。

    odbcinst.ini

    1. Description = PostgreSQL database 1
    2. Driver = postgresql
    3. #CommLog = /tmp/sql.log
    4. Username = zbx_test
    5. Password = zabbix
    6. # Name of Server. IP or DNS
    7. Servername = 127.0.0.1
    8. # Database name
    9. Database = zabbix
    10. Port = 5432
    11. # Database is read only
    12. ReadOnly = No
    13. # PostgreSQL backend protocol
    14. # Note that when using SSL connections this setting is ignored.
    15. # 7.4+: Use the 7.4(V3) protocol. This is only compatible with 7.4 and higher backends.
    16. Protocol = 7.4+
    17. # Includes the OID in SQLColumns
    18. ShowOidColumn = No
    19. # Fakes a unique index on OID
    20. FakeOidIndex = No
    21. # Row Versioning
    22. # Allows applications to detect whether data has been modified by other users
    23. RowVersioning = No
    24. # Show SystemTables
    25. # The driver will treat system tables as regular tables in SQLTables. This is good for Access so you can see system tables.
    26. ShowSystemTables = No
    27. # If true, the driver automatically uses declare cursor/fetch to handle SELECT statements and keeps 100 rows in a cache.
    28. Fetch = Yes
    29. # Bools as Char
    30. # Bools are mapped to SQL_CHAR, otherwise to SQL_BIT.
    31. BoolsAsChar = Yes
    32. # SSL mode
    33. SSLmode = Yes
    34. # Send tobackend on connection