Skip to content

Instantly share code, notes, and snippets.

@ismyrnow
Created December 17, 2015 19:10
Show Gist options
  • Save ismyrnow/faada0a84f30d4c66dc1 to your computer and use it in GitHub Desktop.
Save ismyrnow/faada0a84f30d4c66dc1 to your computer and use it in GitHub Desktop.
Query multiple postgres databases, outputting results as CSV
@echo off
for %%a in (DB1,DB2,DB3) do call psql -h DBHOST -c "SQL" -t -A -F , %%a DBUSER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment