Re: Patch for TNS services

Started by Jan Wieckover 25 years ago12 messages
#1Jan Wieck
janwieck@Yahoo.com

Mario Weilguni wrote:

-----BEGIN PGP SIGNED MESSAGE-----

Last week I created a patch for the Postgres client side libraries to allow
something like a (not so mighty) form of Oracle TNS, but nobody showed any
interest. Currently, the patch is not perfect yet, but works fine for us. I
want to avoid improving the patch if there is no interest in it, so if you
think it might be a worthy improvement please drop me a line.

It works like this:
The patch allows to supply another parameter to the Postgres connect string,
called "service". So, instead of having a connect string (e.g. in PHP) like
"dbname=foo host=bar port=5433 user=foouser password=barpass"
the string would be
"service=stupid_name_here"
or more often
"service=stupid_name_here user=foouser password=barpass"

There's a config [...]

IMHO a good idea.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jan Wieck (#1)

Mario Weilguni <mweilguni@sime.com> writes:

Last week I created a patch for the Postgres client side libraries to allow
something like a (not so mighty) form of Oracle TNS, but nobody showed any
interest. Currently, the patch is not perfect yet, but works fine for us. I
want to avoid improving the patch if there is no interest in it, so if you
think it might be a worthy improvement please drop me a line.

FWIW, it seemed like a moderately reasonable idea to me. But it
troubles me that you didn't get positive responses; as you say, no
point in maintaining the feature unless people will use it.

Perhaps you should bring it up on pgsql-interfaces, which seems like
the most likely place to discuss such a feature.

regards, tom lane

#3Thomas Lockhart
lockhart@alumni.caltech.edu
In reply to: Tom Lane (#2)

Last week I created a patch for the Postgres client side libraries to allow
something like a (not so mighty) form of Oracle TNS, but nobody showed any
interest.

Perhaps it would be helpful to describe TNS: what it does, and what it
is good for. You posted your notice out of the blue, and for those of us
who didn't take the time to research what the heck you were talking
about, there wasn't much point in responding.

There are lots of good ideas floating around out there, and it is a
shame, but true anyway, that it takes most of us a while to warm up to a
new idea or proposal. Thanks for posting a followup message, and it
would be good to hear more about your proposal. I'm sure if it is a
useful feature that it will be of interest in the long run...

Regards.

- Thomas

#4Ross J. Reedstrom
reedstrm@rice.edu
In reply to: Thomas Lockhart (#3)

On Wed, Aug 30, 2000 at 08:04:33PM +0200, Mario Weilguni wrote:

Last week I created a patch for the Postgres client side libraries to allow
something like a (not so mighty) form of Oracle TNS, but nobody showed any
interest. Currently, the patch is not perfect yet, but works fine for us. I
want to avoid improving the patch if there is no interest in it, so if you
think it might be a worthy improvement please drop me a line.

It works like this:
The patch allows to supply another parameter to the Postgres connect string,
called "service". So, instead of having a connect string (e.g. in PHP) like
"dbname=foo host=bar port=5433 user=foouser password=barpass"
the string would be
"service=stupid_name_here"
or more often
"service=stupid_name_here user=foouser password=barpass"

There's a config file /etc/pg_service.conf, having an entry like:
[stupid_name_here]
dbname=foo
host=bar
port=5433
....

Looks kind of like a server side ODBC datasource. Looks useful
to me. I've mainly been using ColdFusion to connect my webpages to
postgresql, via ODBC, and I can attest to the utility of just changing
the host or dbname in the one source being referenced by all that code.
Having it server side, so other interfaces can use the same setup,
would be nice.

Are any of the parameters from your service overrideable? i.e. can it
be used to store defaults, say for username?

Ross
--
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005

#5Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Ross J. Reedstrom (#4)

Sounds like people want it. Can you polish it off, add SGML docs and
send it over?

-----BEGIN PGP SIGNED MESSAGE-----

Last week I created a patch for the Postgres client side libraries to allow
something like a (not so mighty) form of Oracle TNS, but nobody showed any
interest. Currently, the patch is not perfect yet, but works fine for us. I
want to avoid improving the patch if there is no interest in it, so if you
think it might be a worthy improvement please drop me a line.

It works like this:
The patch allows to supply another parameter to the Postgres connect string,
called "service". So, instead of having a connect string (e.g. in PHP) like
"dbname=foo host=bar port=5433 user=foouser password=barpass"
the string would be
"service=stupid_name_here"
or more often
"service=stupid_name_here user=foouser password=barpass"

There's a config file /etc/pg_service.conf, having an entry like:
[stupid_name_here]
dbname=foo
host=bar
port=5433
....

The advantage is you can go from one database host, database, port or
whatever without having to touch the scripts or applications. We're currently
in the process of migrating all of our PHP and Python scripts to another from
localhost, port 5433 to another machine, port 5432 and it's not something I
ever want to do again, I'd to change around 100 files and I'm still not sure
if I've missed one.

The patch is client-side only, around 100 lines, needs no changes to the
backend and is compatible with all applications supplying a connection string
(not using PQsetdblogin)

- --
Why is it always Segmentation's fault?
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv

iQCVAwUBOa1MsQotfkegMgnVAQEIsAP+Na72pNdT+RoQcjuX5cn1TKkPlNAh9BV5
kCNP+Zui6WfZSiA8RYPuruXF0QyEMPZZD6AI9Wqr5sQ75kVSb65uOt9rLrdS0bxA
WTClNjlLKG3Rk1IGSFBm+C0p8lcA3AYTohHLhHB3q+WeLTneI5lJfwpo2AWyinQt
0k/1r6EwpUk=
=+skX
-----END PGP SIGNATURE-----

[ Attachment, skipping... ]

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
#6Valter Mazzola
txian@hotmail.com
In reply to: Bruce Momjian (#5)

yes, i can find this useful

valter

From: Bruce Momjian <pgman@candle.pha.pa.us>
To: mweilguni@sime.com
CC: Postgres Hacker Lister <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] Patch for TNS services
Date: Tue, 12 Sep 2000 01:13:33 -0400 (EDT)

Sounds like people want it. Can you polish it off, add SGML docs and
send it over?

-----BEGIN PGP SIGNED MESSAGE-----

Last week I created a patch for the Postgres client side libraries to

allow

something like a (not so mighty) form of Oracle TNS, but nobody showed

any

interest. Currently, the patch is not perfect yet, but works fine for

us. I

want to avoid improving the patch if there is no interest in it, so if

you

think it might be a worthy improvement please drop me a line.

............
............
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

#7Mario Weilguni
mweilguni@sime.com
In reply to: Bruce Momjian (#5)

Yes, I will try to make it this weekend when I've time.

Am Die, 12 Sep 2000 schrieben Sie:

Show quoted text

Sounds like people want it. Can you polish it off, add SGML docs and
send it over?

-----BEGIN PGP SIGNED MESSAGE-----

Last week I created a patch for the Postgres client side libraries to
allow something like a (not so mighty) form of Oracle TNS, but nobody
showed any interest. Currently, the patch is not perfect yet, but works
fine for us. I want to avoid improving the patch if there is no interest
in it, so if you think it might be a worthy improvement please drop me a
line.

It works like this:
The patch allows to supply another parameter to the Postgres connect
string, called "service". So, instead of having a connect string (e.g. in
PHP) like "dbname=foo host=bar port=5433 user=foouser password=barpass"
the string would be
"service=stupid_name_here"
or more often
"service=stupid_name_here user=foouser password=barpass"

There's a config file /etc/pg_service.conf, having an entry like:
[stupid_name_here]
dbname=foo
host=bar
port=5433
....

The advantage is you can go from one database host, database, port or
whatever without having to touch the scripts or applications. We're
currently in the process of migrating all of our PHP and Python scripts
to another from localhost, port 5433 to another machine, port 5432 and
it's not something I ever want to do again, I'd to change around 100
files and I'm still not sure if I've missed one.

The patch is client-side only, around 100 lines, needs no changes to the
backend and is compatible with all applications supplying a connection
string (not using PQsetdblogin)

- --
Why is it always Segmentation's fault?
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv

iQCVAwUBOa1MsQotfkegMgnVAQEIsAP+Na72pNdT+RoQcjuX5cn1TKkPlNAh9BV5
kCNP+Zui6WfZSiA8RYPuruXF0QyEMPZZD6AI9Wqr5sQ75kVSb65uOt9rLrdS0bxA
WTClNjlLKG3Rk1IGSFBm+C0p8lcA3AYTohHLhHB3q+WeLTneI5lJfwpo2AWyinQt
0k/1r6EwpUk=
=+skX
-----END PGP SIGNATURE-----

[ Attachment, skipping... ]

#8Mario Weilguni
mweilguni@sime.com
In reply to: Bruce Momjian (#5)

Am Die, 12 Sep 2000 schrieb Bruce Momjian:

Sounds like people want it. Can you polish it off, add SGML docs and
send it over?

I prepared and tested a patch vs. 7.0.2, and it works fine. I've added
another option which allows users to have their own service file in
~/.pg_service.conf, which might come handy sometimes.

I tried to add SGML docs, but I'm not sure where to add a section. At first
I'd say in the user.sgml, but I checked it and I'm not sure if this is the
right place. Where shall I add the docs?

And I've a second problem here, I'm no native english speaker and my docs
should be proofread and corrected before adding it.

Show quoted text

-----BEGIN PGP SIGNED MESSAGE-----

Last week I created a patch for the Postgres client side libraries to
allow something like a (not so mighty) form of Oracle TNS, but nobody
showed any interest. Currently, the patch is not perfect yet, but works
fine for us. I want to avoid improving the patch if there is no interest
in it, so if you think it might be a worthy improvement please drop me a
line.

It works like this:
The patch allows to supply another parameter to the Postgres connect
string, called "service". So, instead of having a connect string (e.g. in
PHP) like "dbname=foo host=bar port=5433 user=foouser password=barpass"
the string would be
"service=stupid_name_here"
or more often
"service=stupid_name_here user=foouser password=barpass"

There's a config file /etc/pg_service.conf, having an entry like:
[stupid_name_here]
dbname=foo
host=bar
port=5433
....

The advantage is you can go from one database host, database, port or
whatever without having to touch the scripts or applications. We're
currently in the process of migrating all of our PHP and Python scripts
to another from localhost, port 5433 to another machine, port 5432 and
it's not something I ever want to do again, I'd to change around 100
files and I'm still not sure if I've missed one.

The patch is client-side only, around 100 lines, needs no changes to the
backend and is compatible with all applications supplying a connection
string (not using PQsetdblogin)

- --
Why is it always Segmentation's fault?
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv

iQCVAwUBOa1MsQotfkegMgnVAQEIsAP+Na72pNdT+RoQcjuX5cn1TKkPlNAh9BV5
kCNP+Zui6WfZSiA8RYPuruXF0QyEMPZZD6AI9Wqr5sQ75kVSb65uOt9rLrdS0bxA
WTClNjlLKG3Rk1IGSFBm+C0p8lcA3AYTohHLhHB3q+WeLTneI5lJfwpo2AWyinQt
0k/1r6EwpUk=
=+skX
-----END PGP SIGNATURE-----

[ Attachment, skipping... ]

#9Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#5)

Bruce Momjian writes:

Sounds like people want it. Can you polish it off, add SGML docs and
send it over?

There's a config file /etc/pg_service.conf, having an entry like:

Please check that the final patch uses a file in ${sysconfdir} that was
specified at configure time, and not "/etc". Something like
src/backend/libpq does for the Kerberos files.

--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/

#10Mario Weilguni
mweilguni@sime.com
In reply to: Bruce Momjian (#5)
1 attachment(s)

I've now prepared a polished and clean patch vs. 7.0.2. Who's gonna integrate
this patch in the CVS? I've no CVS access.

The docs are another problem. I've installed jade and most other SGML stuff
here, but "make user.html" fails with errors like :

jade:user.sgml:5:55:W: cannot generate system identifier for public text
"-//OASIS//DTD Dojade:user.sgml:41:0:E: reference to entity "BOOK" for which
no system identifier could be
jade:user.sgml:5:0: entity was defined here
jade:user.sgml:41:0:E: DTD did not contain element declaration for document
type name

The patch is included as attachement (159 lines).

The patch is included

Am Tue, 12 Sep 2000 schrieben Sie:

Show quoted text

Sounds like people want it. Can you polish it off, add SGML docs and
send it over?

-----BEGIN PGP SIGNED MESSAGE-----

Last week I created a patch for the Postgres client side libraries to
allow something like a (not so mighty) form of Oracle TNS, but nobody
showed any interest. Currently, the patch is not perfect yet, but works
fine for us. I want to avoid improving the patch if there is no interest
in it, so if you think it might be a worthy improvement please drop me a
line.

It works like this:
The patch allows to supply another parameter to the Postgres connect
string, called "service". So, instead of having a connect string (e.g. in
PHP) like "dbname=foo host=bar port=5433 user=foouser password=barpass"
the string would be
"service=stupid_name_here"
or more often
"service=stupid_name_here user=foouser password=barpass"

There's a config file /etc/pg_service.conf, having an entry like:
[stupid_name_here]
dbname=foo
host=bar
port=5433
....

The advantage is you can go from one database host, database, port or
whatever without having to touch the scripts or applications. We're
currently in the process of migrating all of our PHP and Python scripts
to another from localhost, port 5433 to another machine, port 5432 and
it's not something I ever want to do again, I'd to change around 100
files and I'm still not sure if I've missed one.

The patch is client-side only, around 100 lines, needs no changes to the
backend and is compatible with all applications supplying a connection
string (not using PQsetdblogin)

- --
Why is it always Segmentation's fault?
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv

iQCVAwUBOa1MsQotfkegMgnVAQEIsAP+Na72pNdT+RoQcjuX5cn1TKkPlNAh9BV5
kCNP+Zui6WfZSiA8RYPuruXF0QyEMPZZD6AI9Wqr5sQ75kVSb65uOt9rLrdS0bxA
WTClNjlLKG3Rk1IGSFBm+C0p8lcA3AYTohHLhHB3q+WeLTneI5lJfwpo2AWyinQt
0k/1r6EwpUk=
=+skX
-----END PGP SIGNATURE-----

[ Attachment, skipping... ]

Attachments:

postgres-7.0-services.patchtext/x-c; name=postgres-7.0-services.patchDownload
diff -Nur postgresql-7.0.2.old/src/interfaces/libpq/fe-connect.c postgresql-7.0.2/src/interfaces/libpq/fe-connect.c
--- postgresql-7.0.2.old/src/interfaces/libpq/fe-connect.c	Sun May 21 23:19:53 2000
+++ postgresql-7.0.2/src/interfaces/libpq/fe-connect.c	Fri Sep 22 17:22:22 2000
@@ -106,6 +106,9 @@
 	{"authtype", "PGAUTHTYPE", DefaultAuthtype, NULL,
 	"Database-Authtype", "D", 20},
 
+	{"service", "PGSERVICE", NULL, NULL,
+	 "Database-Service", "", 20},
+
 	{"user", "PGUSER", NULL, NULL,
 	"Database-User", "", 20},
 
@@ -177,6 +180,8 @@
 static char *conninfo_getval(PQconninfoOption *connOptions,
 				const char *keyword);
 static void defaultNoticeProcessor(void *arg, const char *message);
+static int  parseServiceInfo(PQconninfoOption *options, 
+			     PQExpBuffer errorMessage);
 
 
 /* ----------------
@@ -2072,6 +2077,114 @@
 	return STATUS_OK;
 }
 
+int parseServiceInfo(PQconninfoOption *options, PQExpBuffer errorMessage) {
+  char *service = conninfo_getval(options, "service");
+  char *serviceFile = "/etc/pg_service.conf";
+  int  MAXBUFSIZE = 256;
+  int  group_found = 0;
+  int  linenr=0, i;
+
+  if(service != NULL) {
+    FILE *f;
+    char buf[MAXBUFSIZE], *line;
+    
+    f = fopen(serviceFile, "r");
+    if(f == NULL) {
+      printfPQExpBuffer(errorMessage, "ERROR: Service file '%s' not found\n",
+			serviceFile);
+      return 1;
+    }
+
+    /* As default, set the database name to the name of the service */
+    for(i = 0; options[i].keyword; i++)
+      if(strcmp(options[i].keyword, "dbname") == 0) {
+	if(options[i].val != NULL)
+	  free(options[i].val);
+	options[i].val = strdup(service);
+      }
+    
+    while((line = fgets(buf, MAXBUFSIZE-1, f)) != NULL) {
+      linenr++;
+
+      if(strlen(line) >= MAXBUFSIZE - 2) {
+	fclose(f);
+	printfPQExpBuffer(errorMessage,
+			 "ERROR: line %d too long in service file '%s'\n",
+			  linenr,
+			 serviceFile);
+	return 2;
+      }
+
+      /* ignore EOL at end of line */
+      if(strlen(line) && line[strlen(line)-1] == '\n')
+	line[strlen(line)-1] = 0;
+
+      /* ignore leading blanks */
+      while(*line && isspace(line[0]))
+	line++;
+
+      /* ignore comments and empty lines */
+      if(strlen(line) == 0 || line[0] == '#')
+	continue;
+
+      /* Check for right groupname */
+      if(line[0] == '[') {
+	if(group_found) {
+	  /* group info already read */
+	  fclose(f);
+	  return 0;
+	}
+
+	if(strncmp(line+1, service, strlen(service)) == 0 &&
+	   line[strlen(service)+1] == ']')
+	  group_found = 1;
+	else
+	  group_found = 0;
+      } else {
+	if(group_found) {
+	  /* Finally, we are in the right group and can parse the line */
+	  char *key, *val;
+	  int found_keyword;
+
+	  key = strtok(line, "=");
+	  if(key == NULL) {
+	    printfPQExpBuffer(errorMessage,
+			      "ERROR: syntax error in service file '%s', line %d\n",
+			      serviceFile,
+			      linenr);
+	    fclose(f);
+	    return 3;
+	  }
+	  val = line + strlen(line) + 1;
+	  
+	  found_keyword = 0;
+	  for(i = 0; options[i].keyword; i++) {
+	    if(strcmp(options[i].keyword, key) == 0) {
+ 	      if(options[i].val != NULL)
+ 		free(options[i].val);
+ 	      options[i].val = strdup(val);
+	      found_keyword = 1;
+	    }
+	  }
+
+	  if(!found_keyword) {
+	    printfPQExpBuffer(errorMessage,
+			      "ERROR: syntax error in service file '%s', line %d\n",
+			      serviceFile,
+			      linenr);
+	    fclose(f);
+	    return 3;
+	  }
+	}
+      }
+    }
+
+    fclose(f);
+  }
+
+  return 0;
+}
+
 
 /* ----------------
  * Conninfo parser routine
@@ -2245,6 +2358,14 @@
 		if (option->val)
 			free(option->val);
 		option->val = strdup(pval);
+
+	}
+
+	/* Now check for service info */	
+	if(parseServiceInfo(options, errorMessage)) {
+	  PQconninfoFree(options);
+	  free(buf);
+	  return NULL;
 	}
 
 	/* Done with the modifiable input string */
#11Alex Pilosov
alex@pilosoft.com
In reply to: Bruce Momjian (#5)

Sorry for replying to the fairly old messages, but I just had time to open
my pgsql mailbox:

I would _love_ if your implementation can also implement TNS-style
failover, i.e. having multiple /etc/pg_service.conf entries with same
name. When replication is available, this will provide a efficient and
transparent failover for clients...

One of my projects involves putting all email account information into
postgres, which means postgres needs to be highly available. Now, I can
take care of replication with triggers and hacks, but client-side solution
would really benefit from failover...

-alex

On Tue, 12 Sep 2000, Bruce Momjian wrote:

Show quoted text

Sounds like people want it. Can you polish it off, add SGML docs and
send it over?

-----BEGIN PGP SIGNED MESSAGE-----

Last week I created a patch for the Postgres client side libraries to allow
something like a (not so mighty) form of Oracle TNS, but nobody showed any
interest. Currently, the patch is not perfect yet, but works fine for us. I
want to avoid improving the patch if there is no interest in it, so if you
think it might be a worthy improvement please drop me a line.

It works like this:
The patch allows to supply another parameter to the Postgres connect string,
called "service". So, instead of having a connect string (e.g. in PHP) like
"dbname=foo host=bar port=5433 user=foouser password=barpass"
the string would be
"service=stupid_name_here"
or more often
"service=stupid_name_here user=foouser password=barpass"

There's a config file /etc/pg_service.conf, having an entry like:
[stupid_name_here]
dbname=foo
host=bar
port=5433
....

The advantage is you can go from one database host, database, port or
whatever without having to touch the scripts or applications. We're currently
in the process of migrating all of our PHP and Python scripts to another from
localhost, port 5433 to another machine, port 5432 and it's not something I
ever want to do again, I'd to change around 100 files and I'm still not sure
if I've missed one.

The patch is client-side only, around 100 lines, needs no changes to the
backend and is compatible with all applications supplying a connection string
(not using PQsetdblogin)

- --
Why is it always Segmentation's fault?
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv

iQCVAwUBOa1MsQotfkegMgnVAQEIsAP+Na72pNdT+RoQcjuX5cn1TKkPlNAh9BV5
kCNP+Zui6WfZSiA8RYPuruXF0QyEMPZZD6AI9Wqr5sQ75kVSb65uOt9rLrdS0bxA
WTClNjlLKG3Rk1IGSFBm+C0p8lcA3AYTohHLhHB3q+WeLTneI5lJfwpo2AWyinQt
0k/1r6EwpUk=
=+skX
-----END PGP SIGNATURE-----

[ Attachment, skipping... ]

#12Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Mario Weilguni (#10)

Patch applied. Can you send me the SGML diff? I will merge them in.

I've now prepared a polished and clean patch vs. 7.0.2. Who's gonna integrate
this patch in the CVS? I've no CVS access.

The docs are another problem. I've installed jade and most other SGML stuff
here, but "make user.html" fails with errors like :

jade:user.sgml:5:55:W: cannot generate system identifier for public text
"-//OASIS//DTD Dojade:user.sgml:41:0:E: reference to entity "BOOK" for which
no system identifier could be
jade:user.sgml:5:0: entity was defined here
jade:user.sgml:41:0:E: DTD did not contain element declaration for document
type name

The patch is included as attachement (159 lines).

The patch is included

Am Tue, 12 Sep 2000 schrieben Sie:

Sounds like people want it. Can you polish it off, add SGML docs and
send it over?

-----BEGIN PGP SIGNED MESSAGE-----

Last week I created a patch for the Postgres client side libraries to
allow something like a (not so mighty) form of Oracle TNS, but nobody
showed any interest. Currently, the patch is not perfect yet, but works
fine for us. I want to avoid improving the patch if there is no interest
in it, so if you think it might be a worthy improvement please drop me a
line.

It works like this:
The patch allows to supply another parameter to the Postgres connect
string, called "service". So, instead of having a connect string (e.g. in
PHP) like "dbname=foo host=bar port=5433 user=foouser password=barpass"
the string would be
"service=stupid_name_here"
or more often
"service=stupid_name_here user=foouser password=barpass"

There's a config file /etc/pg_service.conf, having an entry like:
[stupid_name_here]
dbname=foo
host=bar
port=5433
....

The advantage is you can go from one database host, database, port or
whatever without having to touch the scripts or applications. We're
currently in the process of migrating all of our PHP and Python scripts
to another from localhost, port 5433 to another machine, port 5432 and
it's not something I ever want to do again, I'd to change around 100
files and I'm still not sure if I've missed one.

The patch is client-side only, around 100 lines, needs no changes to the
backend and is compatible with all applications supplying a connection
string (not using PQsetdblogin)

- --
Why is it always Segmentation's fault?
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv

iQCVAwUBOa1MsQotfkegMgnVAQEIsAP+Na72pNdT+RoQcjuX5cn1TKkPlNAh9BV5
kCNP+Zui6WfZSiA8RYPuruXF0QyEMPZZD6AI9Wqr5sQ75kVSb65uOt9rLrdS0bxA
WTClNjlLKG3Rk1IGSFBm+C0p8lcA3AYTohHLhHB3q+WeLTneI5lJfwpo2AWyinQt
0k/1r6EwpUk=
=+skX
-----END PGP SIGNATURE-----

[ Attachment, skipping... ]

[ Attachment, skipping... ]

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026