pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: [INTERFACES] Date: Fri, 19 Nov 1999 11:25:20 +1200
3+ messages / 3 participants
[nested] [flat]

* Re: [INTERFACES] Date: Fri, 19 Nov 1999 11:25:20 +1200
@ 1999-11-18 22:51  Lars Strobor <lars@maximillion.sscsinc.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Lars Strobor @ 1999-11-18 22:51 UTC (permalink / raw)
  To: John Henderson <jrh@is.com.fj>; +Cc: pgsql-interfaces@hub.org

John,
I have not used pg.pm, but I use DBI all the time. DBI has drivers for
most popular databases, including Postgres of course. All you do is
install DBI and the Postgres driver (the Postgres DBD), then you can
connect to any machine running Postgres. I don't have the URL of the DBI
page, but go to www.perl.com and lookup DBI.

-Lars

On Thu, 18 Nov 1999, John Henderson wrote:

> Hi,
> 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'm sure this is really obvious...advice?
> John H
> 
> 
> 
> ************
> 




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [INTERFACES] Date: Fri, 19 Nov 1999 11:25:20 +1200
@ 1999-11-19 15:58  Jason Earl <jearl@box100.com>
  1 sibling, 1 reply; 3+ messages in thread

From: Jason Earl @ 1999-11-19 15:58 UTC (permalink / raw)
  To: John Henderson <jrh@is.com.fj>; +Cc: pgsql-interfaces@hub.org

John Henderson wrote:
> 
> Hi,
> 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?

It's a great story.  Is there a sequel (SQL :)?

> 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.

All you actually need is the library and include files.  Copy them over
from moe.  If you followed the default install they should be in
/usr/local/pgsql/lib and /usr/local/pgsql/include.  Installing shared
libraries is a little different for each platform, but the fact that you
got these libraries to work on moe is generally a good sign.

> 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.

If you have the libraries properly installed you should be able to
simply copy the relevant parts of your Perl installation over as well. 
A couple of tarballs should be all you need.

Heck, if you are really ambitious it shouldn't be _too_ hard to roll
your own RPM or deb file (assuming of course you are using Linux or a
platform that uses RPM or deb files).

> I'm sure this is really obvious...advice?
> John H

Good Luck,
Jason



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [INTERFACES] Date: Fri, 19 Nov 1999 11:25:20 +1200
@ 1999-11-22 00:46  Hossein S. Zadeh <hossein@bf.rmit.edu.au>
  parent: Jason Earl <jearl@box100.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Hossein S. Zadeh @ 1999-11-22 00:46 UTC (permalink / raw)
  To: pgsql-interfaces@hub.org

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





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~1999-11-22 00:46 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-11-18 22:51 ` Lars Strobor <lars@maximillion.sscsinc.com>
1999-11-19 15:58 ` Jason Earl <jearl@box100.com>
1999-11-22 00:46   ` Hossein S. Zadeh <hossein@bf.rmit.edu.au>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox