#!/bin/bash
for f in *.sql;
do
psql -U postgres -d postgres -f "$f"
done
echo "sql runner complete";
https://stackoverflow.com/questions/13062168/how-to-execute-multiple-sql-files-in-postgresql-linux
How to execute multiple sql files in postgreSQL linux?
I have many .sql files in a folder (/home/myHSH/scripts) in linux debian. I want to know the command to execute or run all sql files inside the folder into postgreSQL v9.1 database. PostgreSQL
stackoverflow.com
'DB > Postgresql' 카테고리의 다른 글
postgres의 문자열 컬럼을 json으로 파싱 후 이용하는 형태 (0) | 2020.06.17 |
---|---|
PostgreSQL 테이블 용량 확인하기 (0) | 2020.06.15 |
biggint칼럼으로 시퀀스를 쓸때 초기화하는 명령어? (0) | 2020.02.13 |
postgres에서 select 사용시 바로 json으로 받아오기 (0) | 2020.02.13 |
Alter등 간단쿼리 (0) | 2019.12.26 |
댓글