pg_upgrade defaulting to port 25432
Bruce Momjian <bruce@momjian.us>
From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Christopher Browne <cbbrowne@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2011-06-24T01:39:09Z
Lists: pgsql-hackers
Attachments
- /rtmp/pg_upgrade (text/x-diff)
Tom Lane wrote: > Christopher Browne <cbbrowne@gmail.com> writes: > > On Wed, Jun 15, 2011 at 5:35 PM, Bruce Momjian <bruce@momjian.us> wrote: > >> [ just recommend using a different port number during pg_upgrade ] > > > +1... That seems to have lots of nice properties. > > Yeah, that seems like an appropriate expenditure of effort. It's surely > not bulletproof, since someone could intentionally connect to the actual > port number, but getting to bulletproof is a lot more work than anyone > seems to want to do right now. (And, as Bruce pointed out, no complete > solution would be back-patchable anyway.) I have created the following patch which uses 25432 as the default port number for pg_upgrade. It also creates two new environment variables, OLDPGPORT and NEWPGPORT, to control the port values because we don't want to default to PGPORT anymore. This will allow most users to use pg_upgrade without needing to specify port parameters, and will prevent accidental connections. The user does have to specify the port number for live checks, but that was always the case because you have to use different port numbers for old/new in that case. I updated the error message to be clearer about this. The patch is small and might be possible for 9.1, except it changes user-visible behavior, which would suggest it should be in 9.2, plus it doesn't address a serious bug. Comments? I will batckpatch a doc recommendation to use 25432 as a port number for versions of pg_upgrade that don't get this patch. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +