summaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorTom Lane2009-08-28 18:23:53 +0000
committerTom Lane2009-08-28 18:23:53 +0000
commite50ba34ee36ce12cfa56a0040b90477620324765 (patch)
tree331d2f62514e8f34feb8804e1f14f10354347c91 /src/backend/tcop/postgres.c
parent391657ede8f5fac26a17e645df6ac90a24ba015a (diff)
Remove useless code that propagated FrontendProtocol to a backend via a
PostgresMain switch. In point of fact, FrontendProtocol is already set in a backend process, since ProcessStartupPacket() is executed inside the backend --- it hasn't been run by the postmaster for many years. And if it were, we'd still certainly want FrontendProtocol to be set before we get as far as PostgresMain, so that startup errors get reported in the right protocol. -v might have some future use in standalone backends, so I didn't go so far as to remove the switch outright. Also, initialize FrontendProtocol to 0 not PG_PROTOCOL_LATEST. The only likely result of presetting it like that is to mask failure-to-set-it mistakes.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 2beb148d98..a77abdcfc5 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -3075,6 +3075,13 @@ PostgresMain(int argc, char *argv[], const char *username)
}
case 'v':
+ /*
+ * -v is no longer used in normal operation, since
+ * FrontendProtocol is already set before we get here.
+ * We keep the switch only for possible use in standalone
+ * operation, in case we ever support using normal FE/BE
+ * protocol with a standalone backend.
+ */
if (secure)
FrontendProtocol = (ProtocolVersion) atoi(optarg);
break;