|
| 1 | + |
| 2 | +Unix port of psqlodbc, brought to you by: |
| 3 | + Gerald Gryschuk( [email protected]) |
| 4 | + |
| 5 | +This is the first release of a port of psqlodbc to Unix(specifically Linux), |
| 6 | +as such the installation may not be as straight forward as it could be(then |
| 7 | +again it might be). As well the only testing of the driver has been with |
| 8 | +the real project I'm working on, since it seems to be working there I assumed |
| 9 | +it was ready to go out. This port works with Ke Jin's iodbc driver manager |
| 10 | +although there is no theoretical reason why it couldn't work with other |
| 11 | +driver managers for UNIX(I know of none though). The FreeODBC site |
| 12 | +(http://users.ids.net/~bjepson/freeODBC/) has a link to download the current |
| 13 | +version of iodbc(iodbc-2.12). |
| 14 | + |
| 15 | +This driver has been successfully compiled and tested on a RedHat 4.1 system |
| 16 | +using both gcc 2.7.2 and egcs 1.0.2. |
| 17 | + |
| 18 | +INSTALLATION: |
| 19 | + |
| 20 | +If you have a system any where close to mine this will be easy, just |
| 21 | +copy Makefile.lnx to Makefile then type 'make' and see what happens. Note |
| 22 | +that if you have not enabled logging(read the file misc.h) then you |
| 23 | +may get alot of warning messages, just ignore these, they shouldn't be |
| 24 | +a problem. If this doesn't work, well... I don't know what to say, see if |
| 25 | + you can figure out what's wrong,fix it and send me a message. If everything |
| 26 | + makes o.k. you can 'make install' which will install the shared library |
| 27 | +(in /usr/local/lib) and a WINDOWS type INI file in /etc (called odbcinst.ini, |
| 28 | + see CONFIGURATION below). If you want to program using this driver do a |
| 29 | +'make install-headers' which will install programming header files in |
| 30 | +/usr/local/include/iodbc. If you don't like these install locations edit |
| 31 | + Config.mk and change the environment variable DESTDIR(and possible DESTINCDIR |
| 32 | + to get rid of the /iodbc) to suit your system. |
| 33 | + |
| 34 | +CONFIGURATION: |
| 35 | + |
| 36 | +The psqlodbc driver reads two Windows type INI files for configuration, |
| 37 | +one called odbcinst.ini located in /etc which is used for system wide |
| 38 | +configuration of the driver and one in the users home directory called |
| 39 | +.odbc.ini, which can be used to override the system wide settings. Note that |
| 40 | +the location of odbcinst is currently hardcoded into the source so if you |
| 41 | +want to change this you have to change it in the source as well. This latter |
| 42 | +file is also searched for by iodbc and is where |
| 43 | +the DataSource definitions are placed. The format of both files is exactly |
| 44 | +like that of a Windows INI file using key,value pairs. A DataSource definition |
| 45 | +is started with a section name enclosed in square brackets i.e. [PostODBC]. |
| 46 | +Comments are started using a ';' character and are restricted to being |
| 47 | +only on seperate lines(i.e. no comments are allowed on definition lines). |
| 48 | +The important keywords for psqlodbc are: |
| 49 | + Driver = (location where the psqlodbc library was installed) |
| 50 | + ex. Driver = /usr/local/lib/libpspqlodbc.so |
| 51 | + |
| 52 | + ServerName = hostname or ip-address of postgreSQL server |
| 53 | + ex. ServerName = simpsons.springfield.com |
| 54 | + or ServerName = 192.1.1.1 |
| 55 | + |
| 56 | + Database = name of database to connect to |
| 57 | + ex. Database = template1 |
| 58 | + |
| 59 | + Port = tcp port that the postgreSQL server is listening on, note |
| 60 | + that this need not be set as the driver defaults to the |
| 61 | + default postgreSQL port of 5432. Of course if your server |
| 62 | + is listening on a different port than you need to say |
| 63 | + what it is here. |
| 64 | + |
| 65 | + Username = name of authorized postgreSQL user |
| 66 | + ex. Username = homer |
| 67 | + |
| 68 | + Password = the password for the user named in Username. Note |
| 69 | + that if you have password checking on in postgreSQL |
| 70 | + you have to have this field. Unfortunately this means |
| 71 | + storing clear text passwords in a file. If this bothers |
| 72 | + you, well... write a dialog box routine and send it |
| 73 | + to me. |
| 74 | + ex. Password = Doh! |
| 75 | + |
| 76 | + ReadOnly = 0 or 1. Default is 1 => database IS readonly. If |
| 77 | + set to 0, database is read-write. |
| 78 | + ex. ReadOnly = 0 |
| 79 | + |
| 80 | + Protocol = 6.2 to force the use of Postgres 6.2 protocol |
| 81 | + |
| 82 | +The odbcinst.ini file is where sytem wide settings are kept. There are |
| 83 | +quite a number of these, all of which have built-in defaults. Since I'm |
| 84 | +not even sure what they are all for I won't try to describe them, check |
| 85 | +the file dlg_specific.h for a list and some explanation. Two that I found |
| 86 | +useful are Debug and CommLog, which can be used to tailor logging of messages |
| 87 | +by the driver(note that you have to have defined MY_LOG and Q_LOG during |
| 88 | +compilation of the driver, see the file misc.h for an explanation). If |
| 89 | +you have logging On(ie. CommLog = 1 and/or Debug = 1) then logging will |
| 90 | +occur to the files /tmp/mylog.log(Debug, only developers will be |
| 91 | +interested) and /tmp/psqlodbc.log(end user log file). |
| 92 | + |
| 93 | +USE: |
| 94 | + run an ODBC enabled application :-) . |
| 95 | + |
| 96 | + O.k. Well, the only ODBC compliant applications that I can |
| 97 | + "guarantee" to work are those that are compiled using the following |
| 98 | + headers that come with this driver, iodbc.h, isql.h and isqlext.h. |
| 99 | + |
| 100 | +BUGS,etc. |
| 101 | + |
| 102 | + If you have problems with compiling/installing or making this |
| 103 | + package send e-mail to me at: |
| 104 | + [email protected] or to the pgsql-interfaces mailing list |
| 105 | + |
| 106 | + |
| 107 | + Ports to different Unices are greatly appreciated and can probably be |
| 108 | + sent to me for now(although this may change shortly). |
| 109 | + |
| 110 | + Bugs of a general nature should still be sent to the current |
| 111 | + maintainer or to the interfaces list. |
| 112 | + |
| 113 | + |
0 commit comments