Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do i access postgresql from win nt and win98
Message
 
To
26/10/2001 13:09:40
General information
Forum:
Linux
Category:
Databases and Admin issues
Miscellaneous
Thread ID:
00573759
Message ID:
00574033
Views:
32
This message has been marked as the solution to the initial question of the thread.
>how do i access postgresql from win nt and win98 machines
>I have install postgre 7.0.
>Rajesh

Here is a howto:
http://www.fokus.gmd.de/linux/HOWTO/PostgreSQL-HOWTO.html


The process is also described at the following URL, which shows how to setup, among other things, the DNS in windows.
http://softwaredev.earthweb.com/sdopen/article/0,,12406_631251,00.html
Here is an ODBC setup on the Linux side:
http://www.sk.postgresql.org/devel-corner/docs/programmer/odbc.htm
and one for the java equivilent, JDBC:
http://www.sk.postgresql.org/devel-corner/docs/programmer/jdbc.htm

Some hints
http://www.zdnet.com/devhead/stories/articles/0,4413,2608611,00.html
especially
http://www.zdnet.com/devhead/stories/articles/0,4413,2609156,00.html

The database connectivity from StarOffice? is made with ODBC.

StarOffice? configuration to access ODBC data sources is quite the same
once the ODBC sources have been defined.

We use the following ODBC drivers :

unixodbc 2.0.4 for GNU/Linux, from http://www.unixodbc.org/
(package Debian 2.0.4-0.potato3)
psqlodbc 7.1.0005 for Windows, from http://odbc.postgresql.org/
(zip file)


Problems encountered

The unixodbc driver, in many distributions is that it does not
include a "default" /usr/lib/libodbcpsql.so file. Thus you have to
specify the right libodbcpsql.so.* file in the .odbc.ini or odbc.ini /
odbcinst.ini files or create the appropriate link. See below.

The tables must have a primary key defined with a constraint or index
in PostGreSQL in order to allow read-write access to the table from
odbc enabled applications.

The tables indices for primary keys must be named according to the
following scheme in order to be recognized by the PsqlODBC ODBC driver
for windows : "{table}_pkey" (see the FAQ http://www.ca.postgresql.org/ftpsite/odbc/faq.html#primarykeys)

Configuring the PostGreSQL DataBase server

The file pg_hba.conf should specify that PostGreSQL network access is
allowed from the client machines and users.

The postmaster.init file should include the option allowing network
connection (and be launched with -i option)

PGALLOWTCPIP=yes


Configuring the GNU/Linux ODBC driver to allow access to the remote
server

Configure the .odbc.ini file with :

[ODBC Data Source]
foobar = foobar

[foobar]
Description = FOOBAR hostname
Driver = /usr/lib/libodbcpsql.so
Trace = No
Database = template1
Servername = servername.domain.com
UserName? = postgres
Password = postgres
ReadOnly? = No


Beware that the library /usr/lib/libodbcpsql.so exist. If not, create a
link to the appropriate libodbcpsql.so.XXX file.

Configuring the Windows ODBC driver to allow access to the remote server

You should verify that the Read-Only checkboxes aren't checked in the
configuration option dialogs of the driver.

Creating tables structure

If you want to allow read-write access to the tables from StarOffice?
via the windows ODBC PostGreSQL driver, tables must have a primary
key named "{table}_pkey" (see the FAQ
http://www.ca.postgresql.org/ftpsite/odbc/faq.html#primarykeys)

By default, it will be OK if you create the table like this :

CREATE SEQUENCE "table_seq";

CREATE TABLE mytable (
"id" INTEGER PRIMARY KEY DEFAULT NEXTVAL('table_seq'),

...
);


If you use a CONSTRAINT definition, you should pay attention to the name
of the constraint :

CREATE SEQUENCE "table_seq";

CREATE TABLE mytable (
"id" INTEGER DEFAULT NEXTVAL('table_seq'),

...

CONSTRAINT "mytable_pkey" PRIMARY KEY("id")
);




If you use SAMBA
Some of the reasons for getting, "Cannot login to this domain" on Win95 or NT
Networking client OR SAMBA Config.Check these:

>: Samba config: whether it is already the master browser and that the WINS support is switched on, also the right domain name.

>: Windoze 2095/2098: TCP/IP setting -> WINS server is the IP Address of Linux BOX. MS Client setup -> login to domain : be sure you`ve got the right one.

>: Other tricks involve playing with your smb.conf file, and sometimes if you are using encrypted login, read the README`s, you may have to use smbpasswd command to create passwords.
Nebraska Dept of Revenue
Previous
Reply
Map
View

Click here to load this message in the networking platform