Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0a00c9a

Browse files
committed
Remove useless code that propagated FrontendProtocol to a backend via a
PostgresMain switch. In point of fact, FrontendProtocol is already setin a backend process, since ProcessStartupPacket() is executed insidethe 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 beforewe get as far as PostgresMain, so that startup errors get reported in theright protocol.-v might have some future use in standalone backends, so I didn't go sofar as to remove the switch outright.Also, initialize FrontendProtocol to 0 not PG_PROTOCOL_LATEST. The onlylikely result of presetting it like that is to mask failure-to-set-itmistakes.
1 parentc66d9ce commit0a00c9a

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.591 2009/08/2817:42:54 tgl Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.592 2009/08/2818:23:53 tgl Exp $
4141
*
4242
* NOTES
4343
*
@@ -3353,7 +3353,6 @@ BackendRun(Port *port)
33533353
intac;
33543354
longsecs;
33553355
intusecs;
3356-
charprotobuf[32];
33573356
inti;
33583357

33593358
/*
@@ -3397,10 +3396,6 @@ BackendRun(Port *port)
33973396
*/
33983397
split_opts(av,&ac,ExtraOptions);
33993398

3400-
/* Tell the backend what protocol the frontend is using. */
3401-
snprintf(protobuf,sizeof(protobuf),"-v%u",port->proto);
3402-
av[ac++]=protobuf;
3403-
34043399
/*
34053400
* Tell the backend it is being called from the postmaster, and which
34063401
* database to use. -y marks the end of secure switches.

‎src/backend/tcop/postgres.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.569 2009/07/31 20:26:23 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.570 2009/08/28 18:23:53 tgl Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -3075,6 +3075,13 @@ PostgresMain(int argc, char *argv[], const char *username)
30753075
}
30763076

30773077
case'v':
3078+
/*
3079+
* -v is no longer used in normal operation, since
3080+
* FrontendProtocol is already set before we get here.
3081+
* We keep the switch only for possible use in standalone
3082+
* operation, in case we ever support using normal FE/BE
3083+
* protocol with a standalone backend.
3084+
*/
30783085
if (secure)
30793086
FrontendProtocol= (ProtocolVersion)atoi(optarg);
30803087
break;

‎src/backend/utils/init/globals.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/init/globals.c,v 1.108 2009/05/05 19:59:00 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/init/globals.c,v 1.109 2009/08/28 18:23:53 tgl Exp $
1212
*
1313
* NOTES
1414
* Globals used all over the place should be declared here and not
@@ -23,7 +23,7 @@
2323
#include"storage/backendid.h"
2424

2525

26-
ProtocolVersionFrontendProtocol=PG_PROTOCOL_LATEST;
26+
ProtocolVersionFrontendProtocol;
2727

2828
volatileboolInterruptPending= false;
2929
volatileboolQueryCancelPending= false;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp