2 PostgreSQL数据库推荐的UnixODBC设置
安装
- Red Hat Enterprise Linux/CentOS:
- Debian/Ubuntu:
请参阅 为相应的平台下载必要的数据库驱动程序。
配置
通过编辑 odbcinst.ini 和 odbc.ini 文件来完成ODBC的配置。这些配置文件可以在 /etc 文件夹中找到。odbcinst.ini 文件可能不存在,这时我们需要手动来创建它。
odbcinst.ini
Description = PostgreSQL database 1
Driver = postgresql
#CommLog = /tmp/sql.log
Username = zbx_test
Password = zabbix
# Name of Server. IP or DNS
Servername = 127.0.0.1
# Database name
Database = zabbix
Port = 5432
# Database is read only
ReadOnly = No
# PostgreSQL backend protocol
# Note that when using SSL connections this setting is ignored.
# 7.4+: Use the 7.4(V3) protocol. This is only compatible with 7.4 and higher backends.
Protocol = 7.4+
# Includes the OID in SQLColumns
ShowOidColumn = No
# Fakes a unique index on OID
FakeOidIndex = No
# Row Versioning
# Allows applications to detect whether data has been modified by other users
RowVersioning = No
# Show SystemTables
# The driver will treat system tables as regular tables in SQLTables. This is good for Access so you can see system tables.
ShowSystemTables = No
# If true, the driver automatically uses declare cursor/fetch to handle SELECT statements and keeps 100 rows in a cache.
Fetch = Yes
# Bools as Char
# Bools are mapped to SQL_CHAR, otherwise to SQL_BIT.
BoolsAsChar = Yes
# SSL mode
SSLmode = Yes
# Send tobackend on connection