Skip to content
Ryan edited this page Aug 2, 2018 · 2 revisions

pg_dump -U username -v -t building -t building_building_id_seq -t deployed_url -t deployed_url_deployed_url_id_seq -t kiosk_survey -t option -t option_option_id_seq -t project -t project_project_id_seq -t question -t question_question_id_seq -t response -t response_response_id_seq -t survey_info -t survey_info_survey_info_id_seq -t survey_question kiosk > filename

 public | building_building_id_seq         | sequence | sepgroup_nonmsg
 public | deployed_url_deployed_url_id_seq | sequence | sepgroup_nonmsg
 public | oauth_id_seq                     | sequence | webuser
 public | option_option_id_seq             | sequence | sepgroup_nonmsg
 public | project_project_id_seq           | sequence | sepgroup_nonmsg
 public | question_question_id_seq         | sequence | sepgroup_nonmsg
 public | response_response_id_seq         | sequence | sepgroup_nonmsg
 public | survey_info_survey_info_id_seq   | sequence | sepgroup_nonmsg


 public | building        | table | sepgroup_nonmsg
 public | deployed_url    | table | sepgroup_nonmsg
 public | kiosk_survey    | table | sepgroup_nonmsg
 public | oauth           | table | webuser
 public | option          | table | sepgroup_nonmsg
 public | project         | table | sepgroup_nonmsg
 public | question        | table | sepgroup_nonmsg
 public | response        | table | sepgroup_nonmsg
 public | survey_info     | table | sepgroup_nonmsg
 public | survey_question | table | sepgroup_nonmsg
pg_dump -U postgres -v -t building_building_id_seq -t deployed_url_deployed_url_id_seq -t oauth_id_seq -t option_option_id_seq -t project_project_id_seq -t question_question_id -t response_response_id_seq -t survey_info_survey_info_id_seq -t building -t deployed_url -t kiosk_survey -t oauth -t option -t project -t question -t response -t survey_info -t survey_question kiosk > /var/lib/postgresql/kiosk_dump

loading back in: psql -f filename dbname

give permissions to test user: REVOKE ON ALL TABLES IN SCHEMA public FROM PUBLIC; GRANT SELECT, INSERT, UPDATE ON ALL TABLES IN SCHEMA public TO erdl; GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO erdl;

survey_display needs: pip3 install --user toml, flask, psycopg2-binary

Clone this wiki locally