Re: using POSTGRES in a network - Mailing list pgsql-general

From John Burski
Subject Re: using POSTGRES in a network
Date
Msg-id 3AE85116.E1AD730E@911ep.com
Whole thread Raw
In response to using POSTGRES in a network  ("hiroko" <h_ogawa@rnk.co.jp>)
List pgsql-general
hiroko wrote:

> we're now developping a system on Linux, using PostgreSQL.and the
> question this time is abouthow to connect to the DBserver through the
> network (ex,ethernet) from clients.especially on CODINGS. we found a
> lot of info about the way of connecting between DBserver on Linux and
> Windouws user.but few about the Linux-Linux DBconnection, which we do
> need.is anybody knows about this? or have anyone tried it before?

Oh, yeah!  The first thing you'll want to do is to edit the pg_hba.conf
file on the server to permit connections from the Linux clients in
question.  Since you're already allowing Windows clients to connect via
network, you're probably aware of that.

Connecting to the database server via the command line is relatively
easy.  The following example is based on version 6.5.3, but the commands
should be similar for more recent versions:

     psql -h <server> -u <database>

"server" is the name of the server you wish to connect to.  It can be
either an IP address (like 192.168.1.10), an entry in the client's
/etc/hosts file, or available via DNS (we use DNS).  "database" is the
name of the specific database you want to connect to, like "template1"
or what have you.

The above command, once submitted, will request a user ID and password
to complete the connection.  Once the connection is established it's
just like running an interactive session on your localhost.


> when you connect to the remote DBserver from Windows,what you need is
> to set the IP of the server in "hosts"fileand to set your IP as DBuser
> to the server machine.and you can access through the command-line,
> using "psql"but if you wannna do this on the programs??????can you do
> the same thing using the function such as "db_connect" or
> PGDBfunctions???we also need the info about this. we do appreciate for
> your reply . thanks. hiroko

You can connect to the server from within several programming
"environments" (PHP, Perl, C, and C++ come to mind).  The relevant C and
C++ libraries are provided with the PostgreSQL distributions.  You can
learn more about those by studying the Programmer's Guide.

The Perl modules are available from CPAN.  Check out http://www.perl.com
and follow the links.

For more information about PHP connectivity, check out
http://www.php.net.

Hope this helps.

--
John Burski
I.T. Manager
911 Emergency Products
25 Sixth Avenue North
St. Cloud, MN  56303
(320) 656 0076       www.911ep.com

++++++++++++++++++++++++++++++++++
+ How's your cheese holding out? +
++++++++++++++++++++++++++++++++++




pgsql-general by date:

Previous
From: "Geoff Caplan"
Date:
Subject: Re: Need for newbie friendly docs (was Newbie struggling...)
Next
From: "Christian Marschalek"
Date:
Subject: NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s) ?