]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
updated sql.el
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Thu, 30 May 2024 16:04:26 +0000 (18:04 +0200)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Thu, 30 May 2024 16:04:26 +0000 (18:04 +0200)
Signed-off-by: Andreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
lisp/sql.el

index 8a7207fd93b0ee26a581fe0781d3ebe619367e87..3af5f7bdeb3b716e664c90c02604295b43e6995c 100644 (file)
@@ -527,17 +527,20 @@ file.  Since that is a plaintext file, this could be dangerous."
 
     (vertica
      :name "Vertica"
+     :font-lock sql-mode-vertica-font-lock-keywords
      :sqli-program sql-vertica-program
      :sqli-options sql-vertica-options
      :sqli-login sql-vertica-login-params
      :sqli-comint-func sql-comint-vertica
      :list-all ("\\d" . "\\dS")
      :list-table "\\d %s"
+     :completion-object sql-vertica-completion-object
      :prompt-regexp "^[[:alnum:]_]*=[#>] "
      :prompt-length 5
      :prompt-cont-regexp "^[[:alnum:]_]*[-(][#>] "
-     ;; :syntax-alist (("\_" . "w")("\." . "w"))
-     :syntax-alist ((?_ . "w")(?. . "w"))
+     :statement sql-vertica-statement-starters
+     :input-filter sql-remove-tabs-filter
+     :syntax-alist ((?_ . "w"))
      )
     )
   "An alist of product specific configuration settings.
@@ -1504,6 +1507,10 @@ the :statement feature.")
   (regexp-opt '("with"))
   "Additional statement-starting keywords in Postgres.")
 
+(defvar sql-vertica-statement-starters
+  (regexp-opt '("declare" "begin" "with"))
+  "Additional statement-starting keywords in Vertica.")
+
 ;; Font lock support
 
 (defvar sql-mode-font-lock-object-name
@@ -2659,6 +2666,536 @@ regular expressions are created during compilation by calling the
 function `regexp-opt'.  Therefore, take a look at the source before
 you define your own `sql-mode-db2-font-lock-keywords'.")
 
+(defvar sql-mode-vertica-font-lock-keywords
+  (eval-when-compile
+    (list
+     ;; Vertica vsql commands
+     '("^\\s-*\\\\.*$" . font-lock-doc-face)
+
+     ;; Vertica unreserved words but may have meaning
+     (sql-font-lock-keywords-builder 'font-lock-builtin-face nil "approximate_count_distinct_synopsis_info" "approximate_median"
+"approximate_percentile" "acddatatocount" "acddatatolongsyn"
+"acddatatosyn" "acdsyntocount" "acdsyntosyn" "delimitedexport"
+"delimitedexportmulti" "emptymap" "explode" "favroparser"
+"fcefparser" "fcsvparser" "fdelimitedpairparser" "fdelimitedparser"
+"fidxparser" "fjsonparser" "fregexparser" "flextokenizer" "jsonexport"
+"jsonexportmulti" "kafkaavroparser" "kafkacheckbrokers" "kafkaexport"
+"kafkainsertdelimiters" "kafkainsertlengths" "kafkajsonparser"
+"kafkalistmanytopics" "kafkalisttopics" "kafkaoffsets" "kafkaparser"
+"kafkasource" "kafkatopicdetails" "mse" "mapaggregate" "mapcontainskey"
+"mapcontainsvalue" "mapdelimitedextractor" "mapitems" "mapjsonextractor"
+"mapkeys" "mapkeysinfo" "maplookup" "mapput" "mapregexextractor"
+"mapsize" "maptostring" "mapvalues" "mapvaluesorfield" "mapversion"
+"orcexport" "orcexportmulti" "prc" "parquetexport" "parquetexportmulti"
+"pickbesttype" "roc" "stv_asgeojson" "stv_create_index" "stv_dwithin"
+"stv_describe_index" "stv_drop_index" "stv_export2shapefile" "stv_extent"
+"stv_forcelhr" "stv_geography" "stv_geographypoint" "stv_geometry"
+"stv_geometrypoint" "stv_getexportshapefiledirectory" "stv_intersect"
+"stv_isvalidreason" "stv_linestringpoint" "stv_memsize" "stv_nn"
+"stv_polygonpoint" "stv_refresh_index" "stv_rename_index" "stv_reverse"
+"stv_setexportshapefiledirectory" "stv_shpcreatetable"
+"stv_shpparser" "stv_shpsource" "st_area" "st_asbinary" "st_astext"
+"st_boundary" "st_buffer" "st_centroid" "st_contains" "st_convexhull"
+"st_crosses" "st_difference" "st_disjoint" "st_distance" "st_envelope"
+"st_equals" "st_geohash" "st_geographyfromtext" "st_geographyfromwkb"
+"st_geomfromgeohash" "st_geomfromgeojson" "st_geomfromtext"
+"st_geomfromwkb" "st_geometryn" "st_geometrytype" "st_intersection"
+"st_intersects" "st_isempty" "st_issimple" "st_isvalid" "st_length"
+"st_numgeometries" "st_numpoints" "st_overlaps" "st_pointfromgeohash"
+"st_pointn" "st_relate" "st_srid" "st_simplify"
+"st_simplifypreservetopology" "st_symdifference" "st_touches"
+"st_transform" "st_union" "st_within" "st_x" "st_xmax" "st_xmin"
+"st_y" "st_ymax" "st_ymin" "st_intersects" "setmapkeys" "summarize_catcol"
+"summarize_numcol" "unnest" "voltagesecureaccess" "voltagesecureconfigure"
+"voltagesecureconfigureglobal" "voltagesecureprotect"
+"voltagesecureprotectallkeys" "voltagesecurerefreshpolicy"
+"voltagesecureversion" "abs" "acos" "acosh" "active_scheduler_node"
+"add_location" "add_months" "add_null_elements" "add_vertica_options"
+"additional_resource" "advance_epoch" "age_in_months" "age_in_years"
+"allocate_resource" "alter_location_label" "alter_location_size"
+"alter_location_use" "analyze_constraints" "analyze_correlations"
+"analyze_extended_statistics" "analyze_external_row_count"
+"analyze_histogram" "analyze_plan_changes" "analyze_statistics"
+"analyze_statistics_partition" "analyze_workload"
+"analyze_workload_details" "append_centers" "apply_avg"
+"apply_bisecting_kmeans" "apply_count" "apply_count_elements"
+"apply_iforest" "apply_inverse_pca" "apply_inverse_svd" "apply_kmeans"
+"apply_kprototypes" "apply_max" "apply_min" "apply_normalize"
+"apply_one_hot_encoder" "apply_pca" "apply_sum" "apply_sum_float"
+"apply_svd" "approximate_count_distinct"
+"approximate_count_distinct_of_synopsis" "approximate_count_distinct_synopsis"
+"approximate_count_distinct_synopsis_merge" "approximate_quantiles"
+"ar_create_blobs" "ar_final_newton" "ar_save_model" "ar_transition_newton"
+"argmax_agg" "argmin_agg" "arima" "arima_bfgs" "arima_line_search"
+"arima_save_model" "array_cat" "array_collation" "array_contains"
+"array_count" "array_dims" "array_eq" "array_find" "array_ge"
+"array_gt" "array_le" "array_length" "array_lt" "array_neq"
+"array_nullsafe" "ascii" "asin" "asinh" "atan" "atan2" "atanh"
+"audit" "audit_flex" "audit_length" "audit_license_size" "audit_license_term"
+"autoregressor" "avg" "avg_all_columns_local" "azure_token_cache_clear"
+"background_depot_warming" "balance" "barrier" "basename" "binary"
+"binary_and" "binary_cat" "binary_eq" "binary_ge" "binary_gt"
+"binary_le" "binary_lt" "binary_ne" "binary_not" "binary_nullsafe" "binary_or"
+"binary_xor" "bisecting_kmeans" "bisecting_kmeans_init_model" "bit_and"
+"bit_length" "bit_on" "bit_or" "bit_xor" "bitcount" "bits_to_int"
+"bitstring_to_binary" "bk_apply_best_kmeans_results"
+"bk_compute_totss_local" "bk_finalize_model"
+"bk_get_rows_in_active_cluster" "bk_kmeans_compute_local_centers"
+"bk_kmeans_compute_withinss" "bk_kmeans_fast_random_init"
+"bk_kmeans_slow_random_init" "bk_kmeanspp_init_cur_cluster"
+"bk_kmeanspp_reset_blob" "bk_kmeanspp_select_new_centers"
+"bk_kmeanspp_within_chunk_sum" "bk_save_final_model"
+"bk_write_new_cluster_level" "blob_to_table"
+"bool" "bool_and" "bool_nullsafe" "bool_or" "bool_xor" "booleq"
+"boolge" "boolgt" "boolle" "boollt" "boolne" "booltorow"
+"bootstrap_license" "bpchar_nullsafe" "bpchareq" "bpcharge"
+"bpchargt" "bpcharle" "bpcharlt" "bpcharne" "btrim" "bufudx"
+"build_flextable_view" "calc_pseudo_centers" "calculate_alpha_linear"
+"calculate_hessian_linear1" "calculate_hessian_linear2"
+"calendar_hierarchy_day" "cancel_depot_warming"
+"cancel_drain_subcluster" "cancel_rebalance_cluster"
+"cancel_refresh" "cbrt" "ceil" "ceiling"
+"change_current_statement_runtime_priority" "change_model_status"
+"change_runtime_priority" "char" "char_length" "character_length"
+"chi_squared" "chr" "clean_communal_storage" "cleanup_kmeans_files"
+"clear_all_sequence_cache" "clear_caches" "clear_data_collector"
+"clear_data_collector_plans" "clear_data_depot" "clear_debug_log"
+"clear_debug_log_allnodes" "clear_depot_anti_pin_policy_partition"
+"clear_depot_anti_pin_policy_projection"
+"clear_depot_anti_pin_policy_table"
+"clear_depot_pin_policy_partition"
+"clear_depot_pin_policy_projection"
+"clear_depot_pin_policy_table" "clear_depot_reservations"
+"clear_fetch_queue" "clear_hdfs_caches" "clear_lock_usage"
+"clear_mutex_usage" "clear_object_storage_policy" "clear_profiling"
+"clear_projection_recoveries" "clear_projection_refreshes"
+"clear_resource_rejections" "clear_upgrade_marker" "clock_timestamp"
+"clone_subcluster_properties" "close_all_resultsets"
+"close_all_sessions" "close_all_sockets" "close_current_resultset"
+"close_current_resultsets" "close_resultset" "close_session"
+"close_user_sessions" "clr_vertica_options" "coalesce"
+"coerce_collection" "coerce_collection_typmod" "collation"
+"compact_storage" "compare_projections" "complex_join_marker"
+"complex_verifybounds" "complexarray_eq" "complexarray_ne"
+"complexarray_nullsafe" "complexcast" "complexcast_assign"
+"complexrow_nullsafe" "complexroweq" "complexrowge" "complexrowgt"
+"complexrowle" "complexrowlt" "complexrowne"
+"compute_and_save_global_center" "compute_and_save_new_centers"
+"compute_flextable_keys" "compute_flextable_keys_and_build_view"
+"compute_local_totss" "compute_local_withinss"
+"compute_new_local_centers" "concat" "conditional_change_event"
+"conditional_true_event" "confusion_matrix" "contains"
+"coordinate_descent_covariance" "copy_partitions_to_table"
+"copy_table" "corr" "corr_matrix" "cos" "cosh" "cot" "count"
+"count_rows_in_blob" "covar_pop" "covar_samp" "create_aggregator_blob"
+"create_storage_containers" "create_subscription" "cross_validate"
+"cume_dist" "current_database" "current_load_source" "current_schema"
+"current_schemas" "current_session" "current_statement"
+"current_subcluster_name" "current_subcluster_oid"
+"current_trans_id" "current_user" "current_user_oid" "currval"
+"data_collector_cloud_upload_now" "data_collector_help"
+"database_snapshot" "date" "date_eq" "date_ge" "date_gt" "date_le"
+"date_lt" "date_mi" "date_mi_interval" "date_mii" "date_ne"
+"date_nullsafe" "date_part" "date_pl_interval" "date_pli" "date_trunc"
+"datediff" "datetime_pl" "datetimetz_pl" "day" "dayofmonth"
+"dayofweek" "dayofweek_iso" "dayofyear" "days"
+"dbd_add_deployment_catalog" "dbd_add_deployment_design"
+"dbd_add_deployment_drop" "dbd_add_design_projection"
+"dbd_add_design_queries" "dbd_add_design_queries_from_results"
+"dbd_add_design_query" "dbd_add_design_tables"
+"dbd_add_nodes_rebalance_data"
+"dbd_add_nodes_rebalance_data_for_replicated_projections"
+"dbd_add_nodes_rebalance_data_for_segmented_projections"
+"dbd_add_query_override" "dbd_add_table_override"
+"dbd_cancel_populate_design" "dbd_create_deployment" "dbd_create_design"
+"dbd_create_incremental_design" "dbd_create_initial_design"
+"dbd_create_workspace" "dbd_deploy_design"
+"dbd_design_projection_encodings" "dbd_drop_all_deployments"
+"dbd_drop_all_designs" "dbd_drop_all_workspaces"
+"dbd_drop_deployment" "dbd_drop_deployment_design" "dbd_drop_design"
+"dbd_drop_workspace" "dbd_execute_deployment" "dbd_hurry_up_design"
+"dbd_output_add_nodes_rebalance_data_script"
+"dbd_output_all_design_projections"
+"dbd_output_deployment_projection" "dbd_output_deployment_script"
+"dbd_output_design_projections"
+"dbd_output_design_projections_for_tables" "dbd_output_design_query"
+"dbd_output_incremental_design" "dbd_output_initial_design"
+"dbd_populate_design" "dbd_remove_all_design_queries"
+"dbd_remove_all_design_tables" "dbd_remove_all_overrides"
+"dbd_remove_deployment_drops" "dbd_remove_design"
+"dbd_remove_design_queries" "dbd_remove_design_query"
+"dbd_remove_design_table" "dbd_remove_design_tables"
+"dbd_remove_override_by_id" "dbd_remove_query_override"
+"dbd_remove_table_override" "dbd_reset_designid"
+"dbd_reset_refresh_pool_concurrency" "dbd_run_populate_design_and_deploy"
+"dbd_set_analyze_correlations_mode" "dbd_set_deployment_ksafety"
+"dbd_set_deployment_parallelism" "dbd_set_deployment_parallelism_in_design"
+"dbd_set_design_ksafety" "dbd_set_design_query_weight"
+"dbd_set_design_type" "dbd_set_optimization_objective"
+"dbd_set_populate_design_tables_from_queries" "dbd_set_propose_super_first"
+"dbd_set_propose_unsegmented_projections" "dbd_start_populate_design"
+"dbd_wait_for_deployment" "dbd_wait_for_design" "dblink" "dbname" "dcbrt"
+"debug_log_help" "degrees" "demote_subcluster_to_secondary" "dense_rank"
+"describe_load_balance_decision" "designer_add_design_projection"
+"designer_add_design_queries" "designer_add_design_queries_from_results"
+"designer_add_design_query" "designer_add_design_tables"
+"designer_cancel_populate_design" "designer_create_design"
+"designer_design_projection_encodings" "designer_drop_all_designs"
+"designer_drop_design" "designer_execute_deployment"
+"designer_hurry_up_design" "designer_output_all_design_projections"
+"designer_output_deployment_script" "designer_remove_all_design_queries"
+"designer_remove_design_tables" "designer_reset_design"
+"designer_run_populate_design_and_deploy"
+"designer_set_deployment_parallelism" "designer_set_design_ksafety"
+"designer_set_design_query_weight" "designer_set_design_type"
+"designer_set_optimization_objective"
+"designer_set_populate_design_tables_from_queries"
+"designer_set_propose_super_first"
+"designer_set_propose_unsegmented_projections"
+"designer_single_run" "designer_wait_for_design" "detect_outliers"
+"dexp" "dfac" "dfs_delete" "dfs_list" "dfs_rename" "dirname"
+"disable_duplicate_key_error" "disable_local_segments"
+"disable_profiling" "disable_service"
+"disable_syntactic_optimizer" "disk_resources" "display_license"
+"distance" "distancev" "distcall_async" "distcall_checkset"
+"distcall_crash" "distcall_enable_tcp" "distcall_error" "distcall_fragmsg"
+"distcall_hurry" "distcall_no_self" "distcall_ping" "distcall_setset"
+"distcall_warning" "dlog10" "do_tm_task" "does_table_have_data" "dpow"
+"drop_dbd_system_schema" "drop_external_row_count"
+"drop_license" "drop_location" "drop_partition" "drop_partitions"
+"drop_statistics" "drop_statistics_partition"
+"drop_subscription" "dsqrt" "dump_all_catobjindexentries"
+"dump_all_dependencies" "dump_all_locals" "dump_all_newborns"
+"dump_all_objects_by_type" "dump_all_partition_keys" "dump_all_redirects"
+"dump_allocator_usage" "dump_catalog" "dump_delete_vectors"
+"dump_feature_tracker" "dump_livesnapshots" "dump_lock_usage" "dump_locktable"
+"dump_mutex_usage" "dump_partition_keys" "dump_partition_tags"
+"dump_projection_partition_keys" "dump_sessions" "dump_statistics"
+"dump_table_partition_keys" "dump_thread_stacks" "dump_transactions"
+"ee_hash" "ee_misallocate" "ee_statistics" "enable_elastic_cluster"
+"enable_local_segments" "enable_profiling" "enable_schedule" "enable_service"
+"enable_syntactic_optimizer" "enable_tombstones" "enable_trigger"
+"enabled_role" "enforce_object_storage_policy" "error_on_check_false"
+"error_on_null" "error_rate" "evaluate_delete_performance"
+"evaluate_naive_bayes_model" "evaluate_reg_model" "evaluate_svm_model"
+"event_name" "execute_internal_query" "execute_trigger" "exp"
+"exponential_moving_average" "export_catalog" "export_directed_queries"
+"export_model_files" "export_models" "export_objects"
+"export_planning_objects" "export_statistics" "export_statistics_partition"
+"export_tables" "expranal_findbounds" "expranal_makevolatile"
+"expranal_nullint" "expranal_over_range" "expranal_static" "external_config_check"
+"factorial" "fetch_library_files" "filter" "finalize_blob_resource_group"
+"finish_fetching_files" "first_value" "flex_audit_length" "float8"
+"float8_nullsafe" "float8_pl_timestamp" "float8_pl_timestamptz"
+"float8abs" "float8div" "float8eq" "float8ge" "float8gt" "float8le"
+"float8lt" "float8mi" "float8mod" "float8mul" "float8ne" "float8pl"
+"float8um" "float8up" "floatdiv0" "floattocanonicalstring" "floor"
+"flush_data_collector" "flush_debug_log" "flush_reaper_queue" "force_fault"
+"full_memory_report" "generate_spread_config" "get_ahm_epoch"
+"get_ahm_time" "get_attr_minmax" "get_attr_robust_zscore" "get_attr_zscore"
+"get_audit_time" "get_basic_directives" "get_catalog_key"
+"get_catalog_versions" "get_client_label" "get_client_protocol"
+"get_cluster_state_summary" "get_compliance_status" "get_config_parameter"
+"get_current_catalog_version" "get_current_epoch"
+"get_data_collector_notify_policy" "get_data_collector_policy"
+"get_design_ksafe" "get_designer_directives" "get_earliest_epoch"
+"get_ee_test_directives" "get_expected_recovery_epoch"
+"get_kv_projection_metadata" "get_last_good_epoch"
+"get_load_balance_policy" "get_max_attr_size" "get_max_long_attr_size"
+"get_metadata" "get_model_attribute" "get_model_summary"
+"get_node_dependencies" "get_node_dependencies_verbose"
+"get_num_accepted_rows" "get_num_rejected_rows"
+"get_optimizer_directives" "get_preferred_ksafe"
+"get_privileges_description" "get_projection_segments"
+"get_projection_sort_order" "get_projection_status" "get_projections"
+"get_resource_limit" "get_robust_zscore_median" "get_sal_filename"
+"get_sal_test_directives" "get_server_protocol" "get_sizeof_string"
+"get_table_projections" "get_tde_key" "get_upgrade_markers" "get_upgrade_tasks"
+"getdate" "getpid" "getutcdate" "greatest" "greatestb" "group_id" "grouping"
+"grouping_id" "hadoop_impersonation_config_check" "has_role"
+"has_table_privilege" "hash" "hash_external_token" "hash_v0" "hash_v1"
+"hcatalogconnector_config_check" "hdfs_cluster_config_check" "hex_to_binary"
+"hex_to_integer" "hibernate" "hour" "http_server_ctrl" "hurry_service"
+"ifnull" "iforest" "iforest_create_blobs" "iforest_phase0_udf1"
+"iforest_phase0_udf2" "iforest_phase1_udf1" "iforest_phase1_udf2"
+"iforest_phase1_udf3" "iforest_phase1_udf4" "iforest_phase2_udf1"
+"iforest_phase2_udf2" "iforest_phase2_udf3" "iforest_phase2_udf4"
+"iforest_save_model" "ilike" "ilikeb" "implode" "import_directed_queries"
+"import_model_files" "import_models" "import_planning_objects"
+"import_statistics" "impute" "inet_aton" "inet_family" "inet_ntoa"
+"infer_external_table_ddl" "infer_table_ddl" "init_barrier" "initcap"
+"initcapb" "insert" "install_license" "instr" "instrb" "int8" "int8_nullsafe"
+"int8abs" "int8and" "int8div" "int8eq" "int8ge" "int8gt" "int8le" "int8lt"
+"int8mi" "int8mod" "int8mul" "int8mulnn" "int8ne" "int8not" "int8or" "int8pl"
+"int8plnn" "int8shl" "int8shr" "int8um" "int8up" "int8xor" "integer_pl_date"
+"interceptor_debug_test" "internal_boolhash" "internal_dfs_commit_changes"
+"internal_hcatalog_cleanup_ltts" "internal_hcatalog_create_ltt"
+"internal_hcatalog_create_ltts" "internal_numhash" "internal_strhash"
+"internal_to_timestamp" "internal_to_timestamptz" "internal_uuidhash"
+"interrupt_statement" "interval" "interval_div" "interval_div_flt8"
+"interval_eq" "interval_ge" "interval_gt" "interval_le" "interval_lt"
+"interval_mi" "interval_mod" "interval_mul" "interval_ne" "interval_nullsafe"
+"interval_pl" "interval_pl_date" "interval_pl_time" "interval_pl_timestamp"
+"interval_pl_timestamptz" "interval_pl_timetz" "interval_um" "intervalym"
+"inttocanonicalstring" "isorcontains" "isfinite" "isnull" "isutf8"
+"iterate_ros_objs" "julian_day" "kerberos_config_check"
+"kerberos_hdfs_config_check" "kmeans" "kmeansaddmetricstomodel"
+"kmeans_init_blobs" "kmeans_to_write_final_centers" "kprototypes"
+"lag" "last_day" "last_insert_id" "last_value" "ldap_link_dryrun_connect"
+"ldap_link_dryrun_search" "ldap_link_dryrun_sync" "ldap_link_sync_cancel"
+"ldap_link_sync_start" "lead" "lead_storage_oid" "least" "leastb"
+"left" "length" "lift_table" "like" "likeb" "line_search_logistic1"
+"line_search_logistic2" "linear_reg" "list_enabled_ciphers" "list_services"
+"ln" "load_rows_into_blocks" "load_sharded_snapshot_prep"
+"load_snapshot" "load_snapshot_prep" "load_trigger" "local_node_name"
+"local_node_oid" "local_projection_snapshot" "log" "log10"
+"log_database_backup_complete" "log_object_backup_complete"
+"log_object_restore_complete" "log_vbr_invocations" "logistic_reg"
+"lower" "lowerb" "lpad" "ltrim" "make_ahm_now" "makenullable" "makeutf8"
+"manage_epoch" "map_factor" "mark_design_ksafe" "match_columns" "match_id"
+"materialize_flextable_columns" "math_op" "matrix_global_xtx" "matrix_local_xtx"
+"max" "md5" "measure_location_performance" "median" "memory_trim"
+"merge_partitions" "merge_projection_partitions" "metrics"
+"microsecond" "midnight_seconds" "migrate_enterprise_to_eon" "min" "minute"
+"mod" "mode_finder" "model_converter" "modo" "modularhash"
+"modularhash_internal" "modularhash_wrapper" "month"
+"months_between" "move_partitions_to_table" "move_retired_location_data"
+"move_statement_to_resource_pool" "moving_average" "mul_d_interval"
+"mul_interval" "murmurhash" "naive_bayes" "naive_bayes_phase1"
+"naive_bayes_phase1_blob" "naive_bayes_phase2" "new_time" "next_day"
+"nextval" "nilike" "nilikeb" "nlike" "nlikeb" "normalize" "normalize_fit"
+"notify" "now" "nth_value" "ntile" "null_or_empty_array_init"
+"nullif" "nullifzero" "numeric" "numeric_abs" "numeric_add" "numeric_div"
+"numeric_eq" "numeric_ge" "numeric_gt" "numeric_le" "numeric_lt"
+"numeric_mod" "numeric_mul" "numeric_ne" "numeric_nullsafe" "numeric_out"
+"numeric_rescale" "numeric_sub" "numeric_um" "numeric_up" "numericdiv0"
+"numerictocanonicalstring" "nvl" "nvl2" "object_snapshot"
+"occ_modify_table" "octet_length" "one_hot_encoder_fit" "overlaps"
+"overlay" "overlayb" "override_timestamp" "partition_projection"
+"partition_projection_by_value" "partition_table" "partition_table_by_value"
+"partition_table_projections" "pattern_id" "pattern_name" "pca"
+"pca_prep1_global" "pca_prep1_local" "pca_prep2" "percent_rank"
+"percentile_cont" "percentile_cont_v" "percentile_disc" "percentile_disc_v"
+"perf_test_spread" "pg_sleep" "pi" "place_tm_job_marker" "plan_stability_equals"
+"pmml_parser" "poisson_reg" "poll_disk_resources" "position" "positionb"
+"pow" "power" "predict_arima" "predict_autoregressor" "predict_linear_reg"
+"predict_logistic_reg" "predict_moving_average" "predict_naive_bayes"
+"predict_naive_bayes_classes" "predict_pmml" "predict_poisson_reg"
+"predict_rf_classifier" "predict_rf_classifier_classes" "predict_rf_regressor"
+"predict_svm_classifier" "predict_svm_regressor" "predict_xgb_classifier"
+"predict_xgb_classifier_classes" "predict_xgb_regressor"
+"print_catalog_key_config" "print_debug_log" "print_mergeout_cache"
+"print_next_mergeout_job" "print_strata_structures"
+"promote_subcluster_to_primary" "promote_subscription_to_primary" "purge"
+"purge_all_projections" "purge_partition" "purge_projection"
+"purge_session_directives" "purge_table" "purge_table_projections"
+"purge_tombstones" "quarter" "query_hcatalog" "quote_ident" "quote_literal"
+"quote_nullable" "radians" "random" "randomfromtable" "random_init"
+"random_init_write" "randomint" "randomint_crypto" "rank" "read_from_dfblob"
+"read_map_factor" "read_ptree" "read_tree" "realign_control_nodes"
+"rebalance_cluster" "rebalance_shards" "rebalance_table"
+"recompute_node_dependencies" "record_nullsafe" "recordeq" "recordge"
+"recordgt" "recordle" "recordlt" "recordne" "recordrow_nullsafe"
+"recordroweq" "recordrowge" "recordrowgt" "recordrowle" "recordrowlt"
+"recordrowne" "reenable_duplicate_key_error" "reflection_deescape"
+"refresh" "refresh_columns" "reg_final_bfgs" "reg_final_newton"
+"reg_transition_bfgs" "reg_transition_newton" "reg_write_model" "regexp_count"
+"regexp_ilike" "regexp_instr" "regexp_like" "regexp_not_ilike" "regexp_not_like"
+"regexp_replace" "regexp_substr" "register_model" "regr_avgx" "regr_avgy"
+"regr_count" "regr_intercept" "regr_r2" "regr_slope" "regr_sxx" "regr_sxy"
+"regr_syy" "release_all_jvm_memory" "release_jvm_memory" "release_resources"
+"release_session_resource" "release_system_tables_access" "reload_admintools_conf"
+"reload_spread" "remote_file_copy" "remove_blob" "remove_database_snapshot"
+"remove_library_files" "repeat" "replace" "replicate_catalog"
+"reserve_resource" "reserve_session_resource" "reset_basic_directives"
+"reset_designer_directives" "reset_ee_test_directives" "reset_epoch"
+"reset_load_balance_cache" "reset_load_balance_policy" "reset_optimizer_directives"
+"reset_sal_test_directives" "reset_session" "reset_system_tuning_views"
+"reset_udfs_statistics" "reshard_database" "restart_this_node"
+"restore_flextable_default_keys_table_and_view" "restore_location"
+"restrict_system_tables_access" "retire_location" "reverse_normalize"
+"rf_blob" "rf_classifier" "rf_clean" "rf_phase0_udf1" "rf_phase0_udf2"
+"rf_phase1_udf1" "rf_phase1_udf2" "rf_phase1_udf3" "rf_phase1_udf4"
+"rf_phase2_udf1" "rf_phase2_udf2" "rf_phase2_udf3" "rf_phase2_udf4"
+"rf_predictor_importance" "rf_regressor" "rf_save_model" "right"
+"rollover_minmax_obj" "round" "row_number" "row_position"
+"rowrecord_nullsafe" "rowrecordeq" "rowrecordge" "rowrecordgt"
+"rowrecordle" "rowrecordlt" "rowrecordne" "rpad" "rsquared"
+"rtrim" "run_index_tool" "run_load_balance_policy" "run_local_moveout"
+"run_tuple_mover_once" "sandbox_subcluster" "save_cv_result"
+"save_pca_model" "save_plans" "save_session_directives"
+"save_svd_model" "save_svm_model" "sdk_version" "second"
+"security_config_check" "seeded_random" "select_new_centers" "session_user"
+"session_user_oid" "set_ahm_epoch" "set_ahm_time" "set_audit_time"
+"set_basic_directives" "set_client_label" "set_cluster_layout"
+"set_config_parameter" "set_control_mode" "set_control_set_size"
+"set_data_collector_notify_policy" "set_data_collector_policy"
+"set_data_collector_time_policy" "set_database_option"
+"set_debug_log" "set_debug_log_allnodes"
+"set_depot_anti_pin_policy_partition" "set_depot_anti_pin_policy_projection"
+"set_depot_anti_pin_policy_table" "set_depot_pin_policy_partition"
+"set_depot_pin_policy_projection" "set_depot_pin_policy_table"
+"set_designer_directives" "set_do_checkpoint" "set_earliest_epoch"
+"set_earliest_epoch_time" "set_ee_max_threads" "set_ee_test_directives"
+"set_eq" "set_ge" "set_gt" "set_le" "set_load_balance_policy"
+"set_local_segment_threshold" "set_location_performance"
+"set_loglevel" "set_lt" "set_neq" "set_nullsafe"
+"set_object_storage_policy" "set_optimizer_directives"
+"set_preferred_ksafe" "set_rebalance_skew_percent"
+"set_recover_test_settings" "set_sal_test_directives"
+"set_scaling_factor" "set_spread_option" "set_spread_options"
+"set_table_recover_priority" "set_union" "set_vertica_options"
+"sha1" "sha224" "sha256" "sha384" "sha512" "show_all_resultsets"
+"show_all_vertica_options" "show_current_resultset"
+"show_current_resultsets" "show_current_vertica_options"
+"show_profiling_config" "show_rebalance_group_stages"
+"show_resultset" "shutdown" "shutdown_node" "shutdown_subcluster"
+"shutdown_with_drain" "sign" "simulate_upgrade_to_storage_containers"
+"sin" "sinh" "sleep" "snmp_trap_test" "sns_test_connect" "space"
+"split_part" "split_partb" "spread_remove_nodes" "sqrt"
+"src_projection_oid" "start_drain_subcluster" "start_reaping_files"
+"start_rebalance_cluster" "start_refresh" "start_session_trace"
+"start_tuple_mover" "statement_timestamp" "stddev" "stddev_pop"
+"stddev_samp" "stop_session_trace" "stop_tuple_mover"
+"store_minmax_model" "store_one_hot_encoder_model"
+"store_robust_zscore_model" "store_zscore_model"
+"string_to_array" "strpos" "strposb" "substr" "substrb" "substring"
+"sum" "sum_float" "sum_of_count" "svd" "svm_classifier" "svm_regressor"
+"swap_partitions_between_tables" "sync_catalog"
+"sync_with_hcatalog_schema" "sync_with_hcatalog_schema_table"
+"sysdate" "sysinfo_filesystem" "sysinfo_limits" "sysinfo_load"
+"sysinfo_memory" "sysinfo_openfiles" "sysinfo_process"
+"sysinfo_processors" "syslog_event_test" "table_to_blob" "table_to_dfblob"
+"tan" "tanh" "test_concurrent_plan" "test_create_threads"
+"test_data_collector" "test_data_collector_len"
+"test_error_context" "test_internal_statements"
+"test_pattern_event_eval" "test_pattern_match_vector"
+"test_pattern_search_string" "test_vertica_panic" "text" "text_ge"
+"text_gt" "text_le" "text_lt" "textcat" "texteq" "textlen" "textne"
+"thread_pool_report" "throw_error" "tiered_pool_alloc_test" "time"
+"time_eq" "time_ge" "time_gt" "time_le" "time_lt" "time_mi_interval"
+"time_mi_time" "time_ne" "time_nullsafe" "time_pl_interval"
+"time_slice" "timedate_pl" "timeofday" "timestamp" "timestamp_eq"
+"timestamp_ge" "timestamp_gt" "timestamp_le" "timestamp_lt"
+"timestamp_mi" "timestamp_mi_float8" "timestamp_mi_interval"
+"timestamp_ne" "timestamp_nullsafe" "timestamp_pl_float8"
+"timestamp_pl_interval" "timestamp_round" "timestamp_trunc"
+"timestampadd" "timestampdiff" "timestamptz" "timestamptz_eq"
+"timestamptz_ge" "timestamptz_gt" "timestamptz_le" "timestamptz_lt"
+"timestamptz_mi" "timestamptz_mi_float" "timestamptz_mi_interval"
+"timestamptz_ne" "timestamptz_nullsafe" "timestamptz_pl_float8"
+"timestamptz_pl_interval" "timestamptz_to_internal" "timetz"
+"timetz_eq" "timetz_ge" "timetz_gt" "timetz_le" "timetz_lt"
+"timetz_mi_interval" "timetz_mi_timetz" "timetz_ne" "timetz_nullsafe"
+"timetz_pl_interval" "timetzdate_pl" "timezone" "to_array"
+"to_bitstring" "to_char" "to_date" "to_hex" "to_json" "to_number"
+"to_set" "to_timestamp" "to_timestamp_tz" "to_timestamptz"
+"transaction_timestamp" "transfer_service_action" "translate"
+"trunc" "ts_first_value" "ts_last_value" "tune_query"
+"unsandbox_subcluster" "update_and_return_sum_of_squared_distances"
+"update_metadata_pool" "upgrade_and_loadsnapshot"
+"upgrade_model" "upgrade_model_format" "upper" "upperb"
+"uri_percent_decode" "uri_percent_encode"
+"username" "uuid" "uuid_eq" "uuid_ge" "uuid_generate"
+"uuid_gt" "uuid_le" "uuid_lt" "uuid_ne" "uuid_nullsafe" "v6_aton"
+"v6_ntoa" "v6_subneta" "v6_subnetn" "v6_type" "validate_statistics"
+"var_pop" "var_samp" "varbinary" "varchar" "varchar_nullsafe"
+"varchartocanonicalstring" "variance" "verify_hadoop_conf_dir"
+"version" "version_internal" "vertica_epoch_test" "vertica_start_command"
+"vfs_action" "wait_for_ahm_now" "week" "week_iso"
+"width_bucket" "writeInitialKmeansModelToDfs"
+"write_spread_config" "xgb_classifier" "xgb_create_blobs"
+"xgb_phase0_udf1" "xgb_phase0_udf2" "xgb_phase1_udf1"
+"xgb_phase1_udf2" "xgb_phase1_udf3" "xgb_phase2_udf1"
+"xgb_phase2_udf2" "xgb_phase2_udf3" "xgb_predictor_importance"
+"xgb_prune" "xgb_regressor" "xgb_save_model" "year"
+"year_iso" "yule_walker" "zeroifnull"
+)
+
+     ;; Vertica non-reserved words
+     (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
+"abort" "absolute" "access" "action" "add" "admin" "after" "aggregate"
+"also" "alter" "always" "assertion" "assignment" "at" "attribute" "backward"
+"before" "begin" "between" "by" "cache" "called" "cascade" "cascaded"
+"catalog" "chain" "characteristics" "checkpoint" "class" "close"
+"cluster" "coalesce" "comment" "comments" "commit" "committed"
+"configuration" "connection" "constraints" "content" "continue"
+"conversion" "copy" "cost" "createdb" "createrole" "createuser" "csv"
+"current" "cursor" "cycle" "data" "database" "day" "deallocate" "dec"
+"declare" "defaults" "deferred" "definer" "delete" "delimiter"
+"delimiters" "dictionary" "disable" "discard" "document" "domain"
+"drop" "each" "enable" "encoding" "encrypted" "enum" "escape"
+"exclude" "excluding" "exclusive" "execute" "exists" "explain"
+"extension" "external" "extract" "family" "first" "float" "following" "force"
+"forward" "function" "functions" "global" "granted" "greatest"
+"handler" "header" "hold" "hour" "identity" "if" "immediate"
+"immutable" "implicit" "including" "increment" "index" "indexes"
+"inherit" "inherits" "inline" "inout" "input" "insensitive" "insert"
+"instead" "invoker" "isolation" "key" "label" "language" "large" "last"
+"lc_collate" "lc_ctype" "leakproof" "least" "level" "listen" "load" "local"
+"location" "lock" "login" "mapping" "match" "maxvalue" "minute"
+"minvalue" "mode" "month" "move" "names" "national" "nchar"
+"next" "no" "nocreatedb" "nocreaterole" "nocreateuser" "noinherit"
+"nologin" "none"  "noreplication" "nosuperuser" "nothing" "notify" "nowait" "nullif"
+"nulls" "object" "of" "off" "oids" "operator" "option" "options" "out"
+"overlay" "owned" "owner" "parser" "partial" "partition" "passing" "password"
+"plans" "position" "preceding" "precision" "prepare" "prepared" "preserve" "prior"
+"privileges" "procedural" "procedure" "quote" "range" "read"
+"reassign" "recheck" "recursive" "ref" "reindex" "relative" "release"
+"rename" "repeatable" "replace" "replica" "replication" "reset" "restart" "restrict"
+"returns" "revoke" "role" "rollback" "row" "rows" "rule" "savepoint"
+"schema" "scroll" "search" "second" "security" "sequence"
+"serializable" "server" "session" "set" "setof" "share" "show"
+"simple" "snapshot" "stable" "standalone" "start" "statement" "statistics"
+"stdin" "stdout" "storage" "strict" "strip" "substring" "superuser"
+"sysid" "system" "tables" "tablespace" "temp" "template" "temporary"
+"transaction" "treat" "trim" "truncate" "trusted" "type" "types"
+"unbounded" "uncommitted" "unencrypted" "unlisten" "unlogged" "until"
+"update" "vacuum" "valid" "validate" "validator" "value" "values" "varying" "version"
+"view" "volatile" "whitespace" "without" "work" "wrapper" "write"
+"xmlattributes" "xmlconcat" "xmlelement" "xmlexists" "xmlforest" "xmlparse"
+"xmlpi" "xmlroot" "xmlserialize" "year" "yes" "zone"
+)
+
+     ;; Vertica Reserved
+     (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
+"all" "analyse" "analyze" "and" "array" "asc" "as" "asymmetric"
+"binary" "both" "case" "cast" "check" "collate" "column" "constraint"
+"create" "cross" "current_date" "current_role" "current_schema"
+"current_time" "current_timestamp" "current_user" "default"
+"deferrable" "desc" "distinct" "do" "else" "end" "except" "false"
+"fetch" "foreign" "for" "freeze" "from" "full" "grant" "group"
+"having" "ilike" "initially" "inner" "in" "intersect" "into" "isnull"
+"is" "join" "leading" "left" "like" "limit" "localtime"
+"localtimestamp" "natural" "notnull" "not" "null" "offset"
+"only" "on" "order" "or" "outer" "overlaps" "over" "placing" "primary"
+"projection" "references" "returning" "right" "select" "session_user"
+"similar" "some" "symmetric" "table" "then" "to" "trailing" "true"
+"union" "unique" "user" "using" "variadic" "verbose" "when" "where"
+"window" "with"
+)
+
+     ;; Vertica PL/pgSQL
+     (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
+"assign" "if" "case" "loop" "while" "for" "foreach" "exit" "elsif" "return"
+"raise" "execsql" "dynexecute" "perform" "getdiag" "open" "fetch" "move" "close"
+)
+
+     ;; Vertica Data Types
+     (sql-font-lock-keywords-builder 'font-lock-type-face nil
+ "binary" "varbinary" "bytea" "raw" "boolean" "char" "varchar" "date"
+"time" "timestamp" "datetime" "smalldatetime" "interval" "float"
+"float8" "real" "integer" "int" "bigint" "int8" "smallint" "tinyint"
+"decimal" "numeric" "number" "money" "geometry" "geography" "uuid"
+"array" "row" "set")))
+
+  "Vertica SQL keywords used by font-lock.
+
+This variable is used by `sql-mode' and `sql-interactive-mode'.  The
+regular expressions are created during compilation by calling the
+function `regexp-opt'.  Therefore, take a look at the source before
+you define your own `sql-mode-vertica-font-lock-keywords'.")
+
 (defvar sql-mode-font-lock-keywords nil
   "SQL keywords used by font-lock.
 
@@ -5419,6 +5956,41 @@ Try to set `comint-output-filter-functions' like this:
                     (format "\"%s\".\"%s\"" (car tbl) (cadr tbl))))
               cl))))
 
+(defun sql-vertica-completion-object (sqlbuf schema)
+  (sql-redirect sqlbuf "\\t")
+  (let ((aligned
+         (string= "aligned"
+                  (car (sql-redirect-value
+                        sqlbuf "\\a"
+                        "Output format is \\(.*\\)[.]$" 1)))))
+    (when aligned
+      (sql-redirect sqlbuf "\\a"))
+    (let* ((fs (or (car (sql-redirect-value
+                         sqlbuf "\\f" "Field separator is \"\\(.\\)[.]$" 1))
+                   "|"))
+           (re (concat "^\\([^" fs "]*\\)" fs "\\([^" fs "]*\\)"
+                       fs "[^" fs "]*" fs  "[^" fs "]*$"))
+           (cl (if (not schema)
+                   (sql-redirect-value sqlbuf "\\d" re '(1 2))
+                 (append (sql-redirect-value
+                          sqlbuf (format "\\dt %s.*" schema) re '(1 2))
+                         (sql-redirect-value
+                          sqlbuf (format "\\dv %s.*" schema) re '(1 2))
+                         (sql-redirect-value
+                          sqlbuf (format "\\ds %s.*" schema) re '(1 2))))))
+
+      ;; Restore tuples and alignment to what they were.
+      (sql-redirect sqlbuf "\\t")
+      (when (not aligned)
+        (sql-redirect sqlbuf "\\a"))
+
+      ;; Return the list of table names (public schema name can be omitted)
+      (mapcar (lambda (tbl)
+                  (if (string= (car tbl) "public")
+                      (format "\"%s\"" (cadr tbl))
+                    (format "\"%s\".\"%s\"" (car tbl) (cadr tbl))))
+              cl))))
+
 \f
 
 ;;;###autoload