add name of the originating node to application_name
authorTomas Vondra <[email protected]>
Thu, 19 Jan 2017 07:56:07 +0000 (08:56 +0100)
committerTomas Vondra <[email protected]>
Thu, 19 Jan 2017 07:58:48 +0000 (08:58 +0100)
Until now the application_name was set to 'pgxc' for all connections.
Set it to 'pgxc:NODE_NAME' instead, to make it easier to understand
data from pg_stat_activity.

src/backend/pgxc/pool/pgxcnode.c

index cc5df6963e0a74a253d9e3bef19178fa2f0a9103..28a5bbb4c6a5dfb7e475078dc243dc4068b85fbd 100644 (file)
@@ -278,8 +278,8 @@ PGXCNodeConnStr(char *host, int port, char *dbname,
         * remote type can be Coordinator, Datanode or application.
         */
        num = snprintf(connstr, sizeof(connstr),
-                                  "host=%s port=%d dbname=%s user=%s application_name=pgxc sslmode=disable options='-c remotetype=%s -c parentnode=%s %s'",
-                                  host, port, dbname, user, remote_type, parent_node,
+                                  "host=%s port=%d dbname=%s user=%s application_name='pgxc:%s' sslmode=disable options='-c remotetype=%s -c parentnode=%s %s'",
+                                  host, port, dbname, user, parent_node, remote_type, parent_node,
                                   pgoptions);
 
        /* Check for overflow */