Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] Date: Fri, 19 Nov 1999 11:25:20 +1200

From: "Hossein S(dot) Zadeh" <hossein(at)bf(dot)rmit(dot)edu(dot)au>
To: pgsql-interfaces(at)hub(dot)org
Subject: Re: [INTERFACES] Date: Fri, 19 Nov 1999 11:25:20 +1200
Date: 1999-11-22 00:46:28
Message-ID: Pine.OSF.4.02.9911221118210.19494-100000@otto.bf.rmit.edu.au (view raw or flat)
Thread:
Lists: pgsql-interfaces
On Fri, 19 Nov 1999, Jason Earl wrote:

> > Postgresql is installed on server moe and works just fine.
> > I can access it using PHP scripts located on server moe or server bart.
> > Pg.pm perl module is installed on server moe.
> > I can access Postgres just fine using perl cgi's on moe.
> > Isn't this a nice story?
> 
> > Now, I want to use a perl script on server bart to access my PG installation
> > on server moe but to install the Pg module on bart requires that Postgresql
> > be installed first.
> 
> > Ultimately, I want to use perl scripts spread all over the network to access
> > the PG installation on one server only. I don't want to have to install
> > postgres everywhere just to install the perl module.


I use a totally different approach to solve the same problem:

Write a perl script that resides on the postgres server and does whatever
you want those "distributed" scripts to do. In addition, it can open a
TCP/IP port and listen on it.

Clients open a TCP/IP connection to the server (to the port), and pass on
the required information to the perl script. The script does its thing and
returns the result(s) back to the client (on the TCP/IP connection), and
closes the connection.

To be able to cater for more than one client at a time, you can write the
perl script to spawn a child to serve each client.

This way the clients need not have Pg.pm. Hell, they don't even need to
have perl. You can use any program that can open a TCP/IP connection
(which means almost everything under the sun--including even VB).

The actual "meat" of the perl script should be around 20-30 lines (except
the postgres stuff of course).

cheers,
Hossein



In response to

pgsql-interfaces by date

Next:From: Louis BertrandDate: 1999-11-22 01:57:29
Subject: weird Access problem
Previous:From: Sergio A. KesslerDate: 1999-11-21 23:53:15
Subject: Re: [INTERFACES] pg_pwd

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group