1

How can you run a script in multiple PostgreSQL databases in Mac?

1 Answer 1

4
for db in first_db second_db ...; do
    psql -d $db -f yourscript.sql
done

Of course there will be many variations depending on exactly what you want to do.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.