This page will be used to store codes, protocols, and procedures for use by the Data Managers.

Adding a User to Babase

PGPASSWORD='*********' babase-user-add username babase_readers

Backing up the Database or Schemas

[YOU@papio ~]$ pg_dump --help

Restoring the Database or Schemas

[YOU@papio ~]$ pg_dump --file YOURBACKUP.sql --host=localhost --format=c schema=fecal --user lmaryott babase

[YOU@papio ~]$ pg_restore --host=localhost --file=/dev/stdout --user YOU YOURBACKUP.sql

[YOU@papio ~]$ pg_restore --host=localhost --file=YOURRESTORE.sql --user YOU YOURBACKUP.sql

[YOU@papio ~]$ less YOURRESTORE.SQL

{{{CREATE SCHEMA schemaname1;

SET search_path = schemaname1, pg_catalog;

SET default_tablespace = ;

SET default_with_oids = false;}}}

[YOU@papio ~]$ emacs -nw YOURRESTORE.sql
  • IT IS IMPORTANT YOU NOT USE EMACS WITHOUT KNOWLEDGE OF HOW TO EXIT OUT OF IT!!!!!!!
  • After changing the first search path in the file, it should look like the following

{{{CREATE SCHEMA schemaname1;

SET search_path = schemaname2, pg_catalog;

SET default_tablespace =

;

SET default_with_oids = false;}}}

[YOU@papio ~]$ psql --dbname=babase --user=YOU --host=localhost < YOURRESTORE.sql

Wiki content based upon work supported by the National Science Foundation under Grant Nos. 0323553 and 0323596. Any opinions, findings, conclusions or recommendations expressed in this material are those of the wiki contributor(s) and do not necessarily reflect the views of the National Science Foundation.