
    si                         d dl Z d dlZ	 ddZy)    Nc                    |r|t         j                  d<   dd|dt        |      d|ddd|| g}	 t        j                  |d	d	d	
      }	 |rt         j                  d= y	y	# t        j
                  $ r,}t        d|        Y d}~|rt         j                  d= yyd}~wt        $ r" t        d       Y |rt         j                  d= yyw xY w# |rt         j                  d= w w xY w)a  
    Create a PostgreSQL database dump using pg_dump.
    
    Args:
        db_name (str): Database name
        username (str): PostgreSQL username
        output_file (str): Output dump file path
        password (str, optional): PostgreSQL password
        host (str): PostgreSQL host
        port (int): PostgreSQL port
        
    Returns:
        bool: True if successful, False otherwise
    
PGPASSWORDpg_dumpz-hz-pz-Uz-Fcz-fT)checktextcapture_outputz Error creating PostgreSQL dump: NFzOpg_dump command not found. Please ensure PostgreSQL client tools are installed.)osenvironstr
subprocessrunCalledProcessErrorprintFileNotFoundError)	db_nameusernameoutput_filepasswordhostportdump_commandresultes	            9/var/www/python-projects/worksol/horilla_backup/pgdump.pydump_postgres_dbr      s   $ #+

<  	D	L)4
  

<(  (( 045 

<(   _` 

<( 
 

<( s5   A C0B>C C.C CC C)N	localhosti8  )r
   r   r        r   <module>r       s    	  KO4)r   