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