Execute several .sql files in a single transaction using PostgreSQL and bash

后端 未结 4 1391
闹比i
闹比i 2021-01-02 08:50

Say I have the files:

file1.sql
file2.sql
file3.sql

I need all three files to be executed in a single transaction. I\'m looking for a bash

4条回答
  •  情歌与酒
    2021-01-02 09:21

    FYI, for Windows command line:

    FOR /F "usebackq" %A IN (`dir *.sql /b/a-d`) DO psql -f %A
    

提交回复
热议问题