~/.odbc.ini contains user-specified access information for the psqlODBC driver. The file uses conventions typical for Windows Registry files, but despite this restriction can be made to work.
~/.odbc.ini は、ユーザによって指定される psqlODBC ドライバのアクセス 情報が記述されています。 このファイルはWindows レジストリファイルの典型的な慣習をひきずっていますが、 この制限にもかかわらずUNIX上でも動作します。
The .odbc.ini file has three required sections. The first is [ODBC Data Sources] which is a list of arbitrary names and descriptions for each database you wish to access. The second required section is the Data Source Specification and there will be one of these sections for each database. Each section must be labeled with the name given in [ODBC Data Sources] and must contain the following entries:
.odbc.ini ファイルは3つの必須セクションを持っています。 1番目は [ODBC Data Sources] で、あなたが アクセスしたいデータベースそれぞれに付けた任意の名前と説明の一覧です。 2番目の必須セクションはデータソースの仕様で、それぞれのデータ ベースのための項目がそこに1つづつ記載されます。 それぞれの項目 は、 [ODBC Data Sources] で使用されている 名前と同じラベル名を与えられていなければいけませんし、さらに次の 項目を含まなければなりません:
Driver = POSTGRESDIR/lib/libpsqlodbc.so Database=DatabaseName Servername=localhost Port=5432
Tip: Remember that the Postgres database name is usually a single word, without path names of any sort. The Postgres server manages the actual access to the database, and you need only specify the name from the client.
PostgreSQL のデータベース名は、通常 単一語(one word)で、保存先を示すパス名を含まないことに注意してください。 PostgreSQL サーバーがデータベースへの 実際のアクセスを管理しますので、あなたはただクライアント からその名前を指定すればよいのです。
Here is an example .odbc.ini file, showing access information for three databases:
以下は、.odbc.ini ファイルの一例で、 3つのデータベースにアクセスするための情報が記述されています:
[ODBC Data Sources] DataEntry = Read/Write Database QueryOnly = Read-only Database Test = Debugging Database Default = Postgres Stripped [DataEntry] ReadOnly = 0 Servername = localhost Database = Sales [QueryOnly] ReadOnly = 1 Servername = localhost Database = Sales [Test] Debug = 1 CommLog = 1 ReadOnly = 0 Servername = localhost Username = tgl Password = "no$way" Port = 5432 Database = test [Default] Servername = localhost Database = tgl Driver = /opt/postgres/current/lib/libpsqlodbc.so [ODBC] InstallDir = /opt/applix/axdata/axshlib