HOW TO set up odbc-postgresql with unixodbc to allow access to other Unix programs ==================================================================== 1. Install packages unixodbc and odbcinst1 2. Add a PostgreSQL driver to /etc/odbcinst.ini: # odbcinst -i -d -f /usr/lib/postgreql/share/odbcinst.ini.template 3. Add the template1 database (with read only access) to the default odbc.ini # cat /usr/lib/postgreql/share/odbc.ini.template >>/etc/odbc.ini Edit /etc/odbc.ini as required, to add extra databases, change the read only status and so on. 4. Add ODBC required functions to the databases that you wish to access from ODBC: # su - postgres $ for dbname in database1 database2 ... do psql -d $dbname < /usr/lib/postgresql/sahre/odbc.sql done If you include template1 in the list, any database created in future will automatically have these functions included when it is created. At this point, you should be able to use the ODBC access features of anyr application to connect to any of the listed databases. For example, in StarOffice, you can click New->Database, select the ODBC database type and browse the list of databases from /etc/odbc.ini and ~/.odbc.ini. Each user has or can have a file ~/.odbc.ini, whose structure is the same as /etc/odbc.ini. This file is read together with the /etc/odbc.ini to give a complete list of databases accessible to the user. (Of course, any access restrictions imposed by pg_hba.conf are still applicable.) You can create templates for different databases and allow users to add them to their own ~/.odbc.ini. Use the odbc.ini template file provided in /usr/lib/postgreql/lib/odbcinst.ini.template as a model. A good and reliable way for a user to add this template to his ~/.odbc.ini without risk of damaging his file is for him to use this command: $ odbcinst -i -s -f /path/to/your/template/file