Simon Riggs wrote:
> On Wed, 2011-03-09 at 21:21 -0500, Bruce Momjian wrote:
> > Simon Riggs wrote:
> > > On Fri, 2011-03-04 at 23:15 +0900, Fujii Masao wrote:
> > > 
> > > > postgres=# SELECT application_name, state, sync_priority, sync_state
> > > > FROM pg_stat_replication;
> > > >  application_name |   state   | sync_priority | sync_state
> > > > ------------------+-----------+---------------+------------
> > > >  one              | STREAMING |             1 | POTENTIAL
> > > >  two              | streaming |             2 | sync
> > > > (2 rows)
> > > 
> > > Bug! Thanks.
> > 
> > Is there a reason these status are all upper-case?
> 
> NOT AS FAR AS I KNOW.
> 
> I'll add it to the list of changes for beta.

The attached patch lowercases the labels displayed in the view above. 
(The example above was originally all upper-case.)

-- 
  Bruce Momjian  <br...@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
new file mode 100644
index af3c95a..470e6d1
*** a/src/backend/replication/walsender.c
--- b/src/backend/replication/walsender.c
*************** WalSndGetStateString(WalSndState state)
*** 1350,1362 ****
  	switch (state)
  	{
  		case WALSNDSTATE_STARTUP:
! 			return "STARTUP";
  		case WALSNDSTATE_BACKUP:
! 			return "BACKUP";
  		case WALSNDSTATE_CATCHUP:
! 			return "CATCHUP";
  		case WALSNDSTATE_STREAMING:
! 			return "STREAMING";
  	}
  	return "UNKNOWN";
  }
--- 1350,1362 ----
  	switch (state)
  	{
  		case WALSNDSTATE_STARTUP:
! 			return "startup";
  		case WALSNDSTATE_BACKUP:
! 			return "backup";
  		case WALSNDSTATE_CATCHUP:
! 			return "catchup";
  		case WALSNDSTATE_STREAMING:
! 			return "streaming";
  	}
  	return "UNKNOWN";
  }
*************** pg_stat_get_wal_senders(PG_FUNCTION_ARGS
*** 1501,1511 ****
  			 * informational, not different from priority.
  			 */
  			if (sync_priority[i] == 0)
! 				values[7] = CStringGetTextDatum("ASYNC");
  			else if (i == sync_standby)
! 				values[7] = CStringGetTextDatum("SYNC");
  			else
! 				values[7] = CStringGetTextDatum("POTENTIAL");
  		}
  
  		tuplestore_putvalues(tupstore, tupdesc, values, nulls);
--- 1501,1511 ----
  			 * informational, not different from priority.
  			 */
  			if (sync_priority[i] == 0)
! 				values[7] = CStringGetTextDatum("async");
  			else if (i == sync_standby)
! 				values[7] = CStringGetTextDatum("sync");
  			else
! 				values[7] = CStringGetTextDatum("potential");
  		}
  
  		tuplestore_putvalues(tupstore, tupdesc, values, nulls);
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to