Running Queries

The central pane in the Data Explorer view is the SQL Editor. The SQL Editor is an IDE-like input field where users can input SQL queries and execute them in an iterative fashion.

After running a query the results or any errors will appear in the "Query results" tab underneath the SQL Editor.

Queries can be saved in the editor by clicking the "Save" button drop down and choosing "Save as Query". This can be useful for saving queries that output a specific data set that is useful for reporting, or to save a partially finished query to continue to work on later.

Query tabs

Users can operate on multiple queries at a time if needed. Each new query tab that is opened in the Data Explorer provides a completely separate instance of the Data explorer elements, including tables and views lists, SQL editor, and query results. There can be a total of 10 query tabs open in a single window.

SQL Syntax

The SQL version that the Secberus Data warehouse supports is compatible with PostgreSQL 14. There are several administrative functions that are disallowed from including in queries. The full list of prohibited functions

"current_database",
"current_query",
"current_schema",
"current_schemas",
"inet_client_address",
"inet_client_port",
"inet_server_addr",
"inet_server_port",
"pg_backend_pid",
"pg_blocking_pids",
"pg_conf_load_time",
"pg_current_logfile",
"pg_my_temp_schema",
"pg_is_other_temp_schema",
"pg_jit_available",
"pg_listening_channel",
"pg_notification_queue_usage",
"pg_postmaster_start_time",
"pg_safe_snapshot_blocking_pids",
"pg_trigger_depth",
"has_any_column_privilege",
"has_column_privilege",
"has_database_privilege",
"has_foreign_data_wrapper_privilege",
"has_function_privilege",
"has_language_privilege",
"has_schema_privilege",
"has_sequence_privilege",
"has_server_privilege",
"has_table_privilege",
"has_tablespace_privilege",
"has_type_privilege",
"pg_has_role",
"row_security_active",
"pg_collation_is_visible",
"pg_conversion_is_visible",
"pg_function_is_visible",
"pg_opclass_is_visible",
"pg_operator_is_visible",
"pg_opfamily_is_visible",
"pg_statistics_obj_is_visible",
"pg_table_is_visible",
"pg_ts_config_is_visible",
"pg_ts_dict_is_visible",
"pg_ts_parser_is_visible",
"pg_ts_template_is_visible",
"pg_type_is_visible",
"format_type",
"pg_get_catalog_foreign_keys",
"pg_get_constraintdef",
"pg_get_expr",
"pg_get_functiondef",
"pg_get_function_arguments",
"pg_get_function_identity_arguments",
"pg_get_function_result",
"pg_get_indexdef",
"pg_get_keywords",
"pg_get_ruledef",
"pg_get_serial_sequence",
"pg_get_owned_sequence",
"pg_get_statisticsobjdef",
"pg_get_triggerdef",
"pg_get_userbyid",
"pg_get_viewdef",
"pg_get_viewdef",
"pg_get_viewdef",
"pg_index_column_has_property",
"pg_index_has_property",
"pg_indexam_has_property",
"pg_options_to_table",
"pg_tablespace_databases",
"pg_tablespace_databases",
"pg_tablespace_location",
"pg_typeof",
"to_regclass",
"to_regcollation",
"to_regnamespace",
"to_regoper",
"to_regoperator",
"to_regproc",
"to_regprocedure",
"to_regrole",
"to_regtype",
"pg_describe_object",
"pg_identify_object",
"pg_identify_object_as_address",
"pg_get_object_address",
"pg_get_object_address",
"pg_describe_object",
"pg_identify_object",
"pg_identify_object_as_address",
"col_description",
"obj_description",
"obj_description",
"obj_description",
"shobj_description",
"obj_description",
"pg_current_xact_id",
"pg_current_xact_id_if_assigned",
"pg_xact_status",
"pg_current_snapshot",
"pg_snapshot_xip",
"pg_snapshot_xmax",
"pg_snapshot_xmin",
"pg_visible_in_snapshot",
"txid_current",
"txid_current_if_assigned",
"txid_current_snapshot",
"txid_snapshot_xip",
"txid_snapshot_xmax",
"txid_snapshot_xmin",
"txid_visible_in_snapshot",
"txid_status",
"pg_xact_commit_timestamp",
"pg_xact_commit_timestamp_origin",
"pg_last_committed_xact",
"pg_control_checkpoint",
"pg_control_system",
"pg_control_init",
"pg_control_recovery",
"current_setting",
"set_config",
"pg_cancel_backend",
"pg_log_backend_memory_contexts",
"pg_reload_conf",
"pg_rotate_logfile",
"pg_terminate_backend",
"pg_is_in_recovery",
"pg_last_wal_receive_lsn",
"pg_last_wal_replay_lsn",
"pg_last_xact_replay_timestamp",
"pg_is_wal_replay_paused",
"pg_get_wal_replay_pause_state",
"pg_promote",
"pg_wal_replay_pause",
"pg_get_wal_replay_pause_state()",
"pg_is_wal_replay_paused()",
"pg_wal_replay_resume",
"pg_wal_replay_pause",
"pg_wal_replay_resume",
"pg_export_snapshot",
"pg_create_physical_replication_slot",
"pg_drop_replication_slot",
"pg_create_logical_replication_slot",
"pg_copy_physical_replication_slot",
"pg_copy_logical_replication_slot",
"pg_logical_slot_get_changes",
"pg_logical_slot_peek_changes",
"pg_logical_slot_get_binary_changes",
"pg_logical_slot_peek_binary_changes",
"pg_replication_slot_advance",
"pg_replication_origin_create",
"pg_replication_origin_drop",
"pg_replication_origin_oid",
"pg_replication_origin_session_setup",
"pg_replication_origin_session_reset",
"pg_replication_origin_session_is_setup",
"pg_replication_origin_session_progress",
"pg_replication_origin_xact_setup",
"pg_replication_origin_session_setup",
"pg_replication_origin_xact_reset",
"pg_replication_origin_advance",
"pg_replication_origin_progress",
"pg_logical_emit_message",
"pg_column_size",
"pg_column_compression",
"pg_database_size",
"pg_indexes_size",
"pg_relation_size",
"pg_total_relation_size",
"pg_table_size",
"pg_size_bytes",
"pg_size_pretty",
"pg_table_size",
"pg_tablespace_size",
"pg_total_relation_size",
"pg_table_size",
"pg_indexes_size",
"pg_relation_filenode",
"pg_relation_filepath",
"pg_filenode_relation",
"pg_relation_filepath",
"pg_collation_actual_version",
"pg_import_system_collations",
"pg_partition_tree",
"pg_partition_ancestors",
"pg_partition_root",
"brin_summarize_new_values",
"brin_summarize_range",
"brin_summarize_new_values",
"brin_desummarize_range",
"gin_clean_pending_list",
"pg_read_file",
"pg_ls_dir",
"pg_ls_logdir",
"pg_ls_waldir",
"pg_ls_archive_statusdir",
"pg_ls_tmpdir",
"pg_read_file",
"pg_read_binary_file",
"convert_from",
"pg_stat_file",
"pg_advisory_lock",
"pg_advisory_lock_shared",
"pg_advisory_unlock",
"pg_advisory_unlock_all",
"pg_advisory_unlock_shared",
"pg_advisory_xact_lock",
"pg_advisory_xact_lock_shared",
"pg_try_advisory_lock",
"pg_try_advisory_lock_shared",
"pg_try_advisory_xact_lock",
"pg_try_advisory_xact_lock_shared"