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

Commit2f1eaf8

Browse files
committed
Drop server support for FE/BE protocol version 1.0.
While this isn't a lot of code, it's been essentially untestable fora very long time, because libpq doesn't support anything older thanprotocol 2.0, and has not since release 6.3. There's no reason tobelieve any other client-side code still uses that protocol, either.Discussion: <2661.1475849167@sss.pgh.pa.us>
1 parent2b860f5 commit2f1eaf8

File tree

5 files changed

+8
-35
lines changed

5 files changed

+8
-35
lines changed

‎src/backend/access/common/printtup.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,7 @@ SendRowDescriptionMessage(TupleDesc typeinfo, List *targetlist, int16 *formats)
229229
atttypid=getBaseTypeAndTypmod(atttypid,&atttypmod);
230230
pq_sendint(&buf, (int)atttypid,sizeof(atttypid));
231231
pq_sendint(&buf,attrs[i]->attlen,sizeof(attrs[i]->attlen));
232-
/* typmod appears in protocol 2.0 and up */
233-
if (proto >=2)
234-
pq_sendint(&buf,atttypmod,sizeof(atttypmod));
232+
pq_sendint(&buf,atttypmod,sizeof(atttypmod));
235233
/* format info appears in protocol 3.0 and up */
236234
if (proto >=3)
237235
{

‎src/backend/commands/copy.c

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ SendCopyBegin(CopyState cstate)
353353
pq_endmessage(&buf);
354354
cstate->copy_dest=COPY_NEW_FE;
355355
}
356-
elseif (PG_PROTOCOL_MAJOR(FrontendProtocol) >=2)
356+
else
357357
{
358358
/* old way */
359359
if (cstate->binary)
@@ -365,18 +365,6 @@ SendCopyBegin(CopyState cstate)
365365
pq_startcopyout();
366366
cstate->copy_dest=COPY_OLD_FE;
367367
}
368-
else
369-
{
370-
/* very old way */
371-
if (cstate->binary)
372-
ereport(ERROR,
373-
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
374-
errmsg("COPY BINARY is not supported to stdout or from stdin")));
375-
pq_putemptymessage('B');
376-
/* grottiness needed for old COPY OUT protocol */
377-
pq_startcopyout();
378-
cstate->copy_dest=COPY_OLD_FE;
379-
}
380368
}
381369

382370
staticvoid
@@ -399,7 +387,7 @@ ReceiveCopyBegin(CopyState cstate)
399387
cstate->copy_dest=COPY_NEW_FE;
400388
cstate->fe_msgbuf=makeStringInfo();
401389
}
402-
elseif (PG_PROTOCOL_MAJOR(FrontendProtocol) >=2)
390+
else
403391
{
404392
/* old way */
405393
if (cstate->binary)
@@ -411,18 +399,6 @@ ReceiveCopyBegin(CopyState cstate)
411399
pq_startmsgread();
412400
cstate->copy_dest=COPY_OLD_FE;
413401
}
414-
else
415-
{
416-
/* very old way */
417-
if (cstate->binary)
418-
ereport(ERROR,
419-
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
420-
errmsg("COPY BINARY is not supported to stdout or from stdin")));
421-
pq_putemptymessage('D');
422-
/* any error in old protocol will make us lose sync */
423-
pq_startmsgread();
424-
cstate->copy_dest=COPY_OLD_FE;
425-
}
426402
/* We *must* flush here to ensure FE knows it can send. */
427403
pq_flush();
428404
}

‎src/backend/tcop/dest.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ NullCommand(CommandDest dest)
218218
/* ----------------
219219
*ReadyForQuery - tell dest that we are ready for a new query
220220
*
221-
*The ReadyForQuery message is sentin protocol versions 2.0 and up
222-
*so that the FE can tell whenwe are done processing a query string.
221+
*The ReadyForQuery message is sentso that the FE can tell when
222+
*we are done processing a query string.
223223
*In versions 3.0 and up, it also carries a transaction state indicator.
224224
*
225225
*Note that by flushing the stdio buffer here, we can avoid doing it
@@ -241,7 +241,7 @@ ReadyForQuery(CommandDest dest)
241241
pq_sendbyte(&buf,TransactionBlockStatusCode());
242242
pq_endmessage(&buf);
243243
}
244-
elseif (PG_PROTOCOL_MAJOR(FrontendProtocol) >=2)
244+
else
245245
pq_putemptymessage('Z');
246246
/* Flush output at end of cycle in any case. */
247247
pq_flush();

‎src/backend/tcop/postgres.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3768,8 +3768,7 @@ PostgresMain(int argc, char *argv[],
37683768
/*
37693769
* Send this backend's cancellation info to the frontend.
37703770
*/
3771-
if (whereToSendOutput==DestRemote&&
3772-
PG_PROTOCOL_MAJOR(FrontendProtocol) >=2)
3771+
if (whereToSendOutput==DestRemote)
37733772
{
37743773
StringInfoDatabuf;
37753774

‎src/include/libpq/pqcomm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ typedef struct
107107

108108
/* The earliest and latest frontend/backend protocol version supported. */
109109

110-
#definePG_PROTOCOL_EARLIESTPG_PROTOCOL(1,0)
110+
#definePG_PROTOCOL_EARLIESTPG_PROTOCOL(2,0)
111111
#definePG_PROTOCOL_LATESTPG_PROTOCOL(3,0)
112112

113113
typedefuint32ProtocolVersion;/* FE/BE protocol version number */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp