Skip to content

Instantly share code, notes, and snippets.

@jonesd
Last active June 7, 2017 20:15
Show Gist options
  • Save jonesd/4eda6ca455bb5256b25cd4a79003df2f to your computer and use it in GitHub Desktop.
Save jonesd/4eda6ca455bb5256b25cd4a79003df2f to your computer and use it in GitHub Desktop.

Install Postgres by Homebrew

Create DB and access

createdb testdb
psql testdb

Create additional users

psql test
CREATE USER testuser WITH password 'testpassword';
grant all priviliges on database testdb to testuser;

Delete all tables:

select 'drop table if exists "' || tablename || '" cascade;' 
  from pg_tables
 where schemaname = 'public';

Copy and paste the resulting SQL.

May need to also delete sequences.

\d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment