Skip to content

Instantly share code, notes, and snippets.

@youhey
Created September 20, 2012 03:04
Show Gist options
  • Save youhey/3753725 to your computer and use it in GitHub Desktop.
Save youhey/3753725 to your computer and use it in GitHub Desktop.
PostgreSQLデータベースサーバ上で稼働しているデータベースの名前を一覧表示
psql --user=postgres --list --tuples-only --pset="format=unaligned" --pset="fieldsep=," | sed 's!^postgres=CTc/postgres$!!g' | cut --delimiter="," --fields=1 | sed -e 's/^template[01]$//g' -e '/^$/d'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment