Ignore attempts to set "application_name" in the connection startup packet.

This avoids a useless connection retry and complaint in the postmaster log
when receiving a connection from 8.5 or later libpq.

Backpatch in all supported branches, but of course *not* HEAD.
This commit is contained in:
Tom Lane 2009-12-02 17:41:07 +00:00
parent b382cbb044
commit e461436f87

View File

@ -37,7 +37,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.583.2.6 2009/08/24 20:08:40 tgl Exp $ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.583.2.7 2009/12/02 17:41:07 tgl Exp $
* *
* NOTES * NOTES
* *
@ -1660,6 +1660,8 @@ retry1:
port->user_name = pstrdup(valptr); port->user_name = pstrdup(valptr);
else if (strcmp(nameptr, "options") == 0) else if (strcmp(nameptr, "options") == 0)
port->cmdline_options = pstrdup(valptr); port->cmdline_options = pstrdup(valptr);
else if (strcmp(nameptr, "application_name") == 0)
/* ignore for compatibility with libpq >= 8.5 */ ;
else else
{ {
/* Assume it's a generic GUC option */ /* Assume it's a generic GUC option */