~ubuntu-branches/ubuntu/natty/psqlodbc/natty

« back to all changes in this revision

Viewing changes to debian/README.Debian

  • Committer: Bazaar Package Importer
  • Author(s): Peter Eisentraut
  • Date: 2004-11-14 16:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20041114161231-hurw3wphq2vr9sr4
Tags: 1:07.03.0200-5
* Corrected license to old LGPL 2
* Big debian/rules modernization
* Moved odbc.ini.template to examples directory
* Converted to dpatch
* Added update of config.{guess,sub}
* Renamed unixodbc.HOWTO to README.Debian; revised
* Moved installation to /usr/lib/odbc; added symlink to old location
  for compatibility
* Dropped postgresql-dev dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
PostgreSQL ODBC driver on Debian
 
2
================================
 
3
 
 
4
This package contains the PostgreSQL ODBC driver built for the
 
5
unixODBC driver manager.  Applications wishing to make use of it need
 
6
work with unixODBC (instead of some other ODBC driver manager).  On
 
7
Debian, this normally means that they have a dependency on the package
 
8
"unixodbc".
 
9
 
 
10
Setup of odbc-postgresql
 
11
------------------------
 
12
 
 
13
Register the PostgreSQL driver in /etc/odbcinst.ini:
 
14
 
 
15
# odbcinst -i -d -f /usr/share/psqlodbc/odbcinst.ini.template
 
16
 
 
17
Add additional ODBC functions to the databases that you plan to access
 
18
from ODBC:
 
19
 
 
20
# su - postgres
 
21
$ for dbname in database1 database2 ...
 
22
  do
 
23
    psql -d $dbname < /usr/share/psqlodbc/odbc.sql
 
24
  done
 
25
 
 
26
If you include template1 in the list, any database created in future
 
27
will automatically have these functions included when it is created.
 
28
 
 
29
To be able to access a particular database via ODBC you need to
 
30
register it as an ODBC data source.  Data sources are registered
 
31
globally in /etc/odbc.ini or for each user in ~/.odbc.ini.  An example
 
32
entry is included in this package.  You can install it like this:
 
33
 
 
34
# cat /usr/share/doc/odbc-postgresql/examples/odbc.ini.template >>/etc/odbc.ini
 
35
 
 
36
This will give you read-only access to the template1 database on the
 
37
PostgreSQL server on localhost.
 
38
 
 
39
You should edit /etc/odbc.ini as required, to add extra databases,
 
40
change the read only status, and so on.
 
41
 
 
42
At this point, you should be able to use the ODBC access features of
 
43
any application to connect to any of the listed databases.  For
 
44
example, in OpenOffice.org, you can click Tools->Data Sources, select
 
45
the ODBC database type, and browse the list of databases from
 
46
/etc/odbc.ini and ~/.odbc.ini.
 
47
 
 
48
A good and reliable way for a user to add a template to his
 
49
~/.odbc.ini without risk of damaging the file is to use this command:
 
50
 
 
51
$ odbcinst -i -s -f /path/to/your/template/file
 
52
 
 
53
 
 
54
Accessing Schemas
 
55
-----------------
 
56
 
 
57
If you have schemas that are not in the default search path ($user,
 
58
public) you have to set the search path in the connection settings of
 
59
the odbc.ini file.  Here's an example, where the search path must be
 
60
set to prod, public:
 
61
 
 
62
    [Production]
 
63
    Description         = Production control
 
64
    Driver              = PostgreSQL
 
65
    Trace               = No
 
66
    TraceFile           = /tmp/psqlodbc.log
 
67
    Database            = companydb
 
68
    Servername          = localhost
 
69
    UserName            = userme
 
70
    Password            =
 
71
    Port                = 5432
 
72
    Protocol            = 6.4
 
73
    ReadOnly            = No
 
74
    RowVersioning       = Yes
 
75
    ShowSystemTables    = No
 
76
    ShowOidColumn       = No
 
77
    FakeOidIndex        = No
 
78
    ConnSettings        = SET SEARCH_PATH TO prod, public