Hi

Currently tab completion for 'COMMENT ON {object} foo IS' will result in the 
'IS'
being duplicated up to two times; not a world-shattering issue I know, but the
fix is trivial and I stumble over it often enough to for it to mildly annoy me.
Patch attached.


Regards

Ian Barwick

--
 Ian Barwick                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
new file mode 100644
index 82c926d..7212015
*** a/src/bin/psql/tab-complete.c
--- b/src/bin/psql/tab-complete.c
*************** psql_completion(const char *text, int st
*** 2130,2141 ****
  	{
  		COMPLETE_WITH_QUERY(Query_for_list_of_event_triggers);
  	}
! 	else if ((pg_strcasecmp(prev4_wd, "COMMENT") == 0 &&
! 			  pg_strcasecmp(prev3_wd, "ON") == 0) ||
! 			 (pg_strcasecmp(prev5_wd, "COMMENT") == 0 &&
! 			  pg_strcasecmp(prev4_wd, "ON") == 0) ||
! 			 (pg_strcasecmp(prev6_wd, "COMMENT") == 0 &&
! 			  pg_strcasecmp(prev5_wd, "ON") == 0))
  		COMPLETE_WITH_CONST("IS");
  
  /* COPY */
--- 2130,2142 ----
  	{
  		COMPLETE_WITH_QUERY(Query_for_list_of_event_triggers);
  	}
! 	else if (((pg_strcasecmp(prev4_wd, "COMMENT") == 0 &&
! 			   pg_strcasecmp(prev3_wd, "ON") == 0) ||
! 			  (pg_strcasecmp(prev5_wd, "COMMENT") == 0 &&
! 			   pg_strcasecmp(prev4_wd, "ON") == 0) ||
! 			  (pg_strcasecmp(prev6_wd, "COMMENT") == 0 &&
! 			   pg_strcasecmp(prev5_wd, "ON") == 0)) &&
! 			   pg_strcasecmp(prev_wd, "IS") != 0)
  		COMPLETE_WITH_CONST("IS");
  
  /* COPY */
-- 
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