Reputation: 895
I want to know if we can pass list of sql script files using psql command.
I have test1.sql,test2.sql,test3.sql files and right now i am executing these files individually in a loop
psql -f D:\\test1.sql postgresql://postgres:secret@localhost:5432/testdb
I want to know if there is any way to pass all three files to the psql command and psql should execute it sequentially.
Upvotes: 2
Views: 1104
Reputation:
You can use the -f
parameter multiple times:
psql -f D:\\test1.sql -f D:\\test2.sql -f D:\\test3.sql postgresql://postgres:secret@localhost:5432/testdb
Upvotes: 3