3 DATA_DIR=/srv/ncbi/db_snp/
4 SCHEMA_DIR=/srv/ncbi/db_snp_utils/schema
5 UTIL_DIR=${SCHEMA_DIR}/../utils/
8 psql -c "DROP DATABASE $DB";
9 psql -c "CREATE DATABASE $DB";
13 (cd ${SCHEMA_DIR}/shared_schema;
14 cat dbSNP_main_table_postgresql.sql |psql "$DB";
16 (cd ${SCHEMA_DIR}/human_9606_schema;
17 cat *_table_postgresql.sql|psql "$DB";
18 ${UTIL_DIR}/human_gty1_indexes_creation.pl create trigger |psql "$DB";
20 (cd ${DATA_DIR}/shared_data;
21 for a in $(find -type f -iname '*.bcp.gz' -printf '%f\n'|sort); do
23 zcat $a | perl -pe 's/\r/\\r/g' |psql "$DB" -c "COPY ${a%%.bcp.gz} FROM STDIN WITH NULL ''";
26 (cd ${DATA_DIR}/organism_data;
27 for a in $(find -type f -iname '*.bcp.gz' -printf '%f\n'|sort); do
29 zcat $a | perl -pe 's/\r/\\r/g' |psql "$DB" -c "COPY ${a%%.bcp.gz} FROM STDIN WITH NULL ''";
32 (cd ${SCHEMA_DIR}/shared_schema;
33 cat dbSNP_main_index_postgresql.sql dbSNP_main_constraint_postgresql.sql|psql "$DB";
35 (cd ${SCHEMA_DIR}/human_9606_schema;
36 cat *_{index,constraint}_postgresql.sql|psql "$DB";
37 ${UTIL_DIR}/human_gty1_indexes_creation.pl index |psql "$DB";