NT tab complete patch

Started by Gaetano Mendolaover 21 years ago1 messages
#1Gaetano Mendola
mendola@bigfoot.com
1 attachment(s)

Hi all,
I'm trying the savepoint-5.patch

Using the psql the TAB autocomplete doesn't work for savepoint and for release commands,
also the ROLLBACK doesn't know yet the ROLLBACK TO sintax.

Attached the patch that solve these issues.

BTW, there is a way to know which savepoint are active ?

Regards
Gaetano Mendola

Attachments:

savepoint_tab_complete.patchtext/plain; name=savepoint_tab_complete.patchDownload
--- pgsql_patched/src/bin/psql/tab-complete.c	2004-07-19 17:21:50.000000000 +0200
+++ pgsql/src/bin/psql/tab-complete.c	2004-05-26 15:56:55.000000000 +0200
@@ -463,8 +463,8 @@
 		"ABORT", "ALTER", "ANALYZE", "BEGIN", "CHECKPOINT", "CLOSE", "CLUSTER", "COMMENT",
 		"COMMIT", "COPY", "CREATE", "DEALLOCATE", "DECLARE", "DELETE", "DROP", "EXECUTE",
 		"EXPLAIN", "FETCH", "GRANT", "INSERT", "LISTEN", "LOAD", "LOCK", "MOVE", "NOTIFY",
-		"PREPARE", "REINDEX", "RELEASE", "RESET", "REVOKE", "ROLLBACK", "SAVEPOINT", 
-                "SELECT", "SET", "SHOW", "START", "TRUNCATE", "UNLISTEN", "UPDATE", "VACUUM", NULL
+		"PREPARE", "REINDEX", "RESET", "REVOKE", "ROLLBACK", "SELECT", "SET", "SHOW", "START",
+		"TRUNCATE", "UNLISTEN", "UPDATE", "VACUUM", NULL
 	};
 
 	static const char * const pgsql_variables[] = {
@@ -726,6 +726,7 @@
 	else if (pg_strcasecmp(prev_wd, "BEGIN") == 0 ||
 	         pg_strcasecmp(prev_wd, "END") == 0 ||
 	         pg_strcasecmp(prev_wd, "COMMIT") == 0 ||
+	         pg_strcasecmp(prev_wd, "ROLLBACK") == 0 ||
 	         pg_strcasecmp(prev_wd, "ABORT") == 0)
 	{
 		static const char * const list_TRANS[] =
@@ -733,14 +734,6 @@
 
 		COMPLETE_WITH_LIST(list_TRANS);
 	}
-/* ROLLBACK*/
-	else if ( pg_strcasecmp(prev_wd, "ROLLBACK") == 0 )
-	{
-		static const char * const list_TRANS[] =
-		{"WORK", "TRANSACTION", "TO", NULL};
-
-		COMPLETE_WITH_LIST(list_TRANS);
-	}
 /* CLUSTER */
 	/* If the previous word is CLUSTER, produce list of indexes. */
 	else if (pg_strcasecmp(prev_wd, "CLUSTER") == 0)