Merge pull request #141 from khoazero123/fix_postgres_restore

Fix postgres restore wrong db type
This commit is contained in:
Dave Conroy
2022-07-22 11:58:57 -07:00
committed by GitHub

View File

@@ -271,7 +271,7 @@ get_dbtype() {
parsed_type=true
print_debug "Parsed DBType: MariaDB/MySQL"
;;
psql | postgres* )
pgsql | postgres* )
parsed_type=true
print_debug "Parsed DBType: Postgresql"
;;
@@ -908,7 +908,7 @@ case "${r_dbtype}" in
pv ${r_filename} | ${decompress_cmd}cat | mysql -u${r_dbuser} -p${r_dbpass} -P${r_dbport} -h${r_dbhost} ${r_dbname}
exit_code=$?
;;
psql | postgres* )
pgsql | postgres* )
print_info "Restoring '${r_filename}' into '${r_dbhost}'/'${r_dbname}'"
export PGPASSWORD=${r_dbpass}
pv ${r_filename} | ${decompress_cmd}cat | psql -d ${r_dbname} -h ${r_dbhost} -p ${r_dbport} -U ${r_dbuser}