You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: validator.rs
    path of file: ./repos/dozer/dozer-ingestion/postgres/src/connection
    
    the code of the file until where you have to start completion: use crate::{connector::ReplicationSlotInfo, PostgresConnectorError};

use super::{client::Client, tables_validator::TablesValidator};
use dozer_ingestion_connector::{
    dozer_types::indicatif::{ProgressBar, ProgressStyle},
    utils::ListOrFilterColumns,
};
use postgres_types::PgLsn;
use regex::Regex;

pub enum Validations {
    Details,
    User,
    Tables,
    WALLevel,
    Slot,
}

pub async fn validate_connection(
    name: &str,
    config: tokio_postgres::Config,
    tables: Option<&Vec<ListOrFilterColumns>>,
    replication_info: Option<ReplicationSlotInfo>,
) -> Result<(), PostgresConnectorError> {
    let validations_order: Vec<Validations> = vec![
        Validations::Details,
        Validations::User,
        Validations::Tables,
        Validations::WALLevel,
        Validations::Slot,
    ];
    let pb = ProgressBar::new(validations_order.len() as u64);
    pb.set_style(
        ProgressS
    
    // fn test_connector_validation_connection_user_not_have_permission_to_use_replication() {
    //     run_connector_test("postgres", |app_config| {
    //         let mut config = get_config(app_config);
    //         let mut client = postgres::Config::from(config.clone())
    //             .connect(NoTls)
    //             .unwrap();
    //
    //         client
    //             .simple_query("DROP USER if exists dozer_test_without_permission")
    //             .expect("User delete failed");
    //
    //         client
    //             .simple_query("CREATE USER dozer_test_without_permission")
    //             .expect("User creation failed");
    //
    //         client
    //             .simple_query("ALTER ROLE dozer_test_without_permission WITH NOREPLICATION")
    //             .expect("Role update failed");
    //
    //         config.user("dozer_test_without_permission");
    //
    //         let result = validate_connection(config, None, None);
    //
    //         assert!(result.is_err());
    //
    //         match result {
    //             Ok(_) => panic!("Validation should fail"),
    //             Err(e) => {
    //                 assert!(matches!(
    //                     e,
    //                     PostgresConnectorError::ReplicationIsNotAvailableForUserError
    //                 ));
    //             }
    //         }
    //     });
    // }