Merge "Issue #1051 Upgrade script for bufrmos invalid locations. Change-Id: I78b29e173654d0066852b650d4d791920fc07977" into development

Former-commit-id: 317f1bc568 [formerly 6a6474c924 [formerly f2b63d24b1] [formerly 317f1bc568 [formerly f19ce489e7a0f3b671cb8a85cc445d48c6fc5f91]]]
Former-commit-id: 6a6474c924 [formerly f2b63d24b1]
Former-commit-id: 6a6474c924
Former-commit-id: 158fcae8e4
This commit is contained in:
Richard Peter 2013-07-30 21:34:54 -05:00 committed by Gerrit Code Review
commit cc9e05df79

View file

@ -0,0 +1,11 @@
#!/bin/bash
# DR #1051 remove invalid bufrmos locations
PSQL="/awips2/psql/bin/psql"
${PSQL} -U awips -d metadata -c "DELETE FROM bufrmosmrf WHERE location_id IN (SELECT DISTINCT id FROM bufrmos_location WHERE latitude > 90 or latitude < -90);"
${PSQL} -U awips -d metadata -c "DELETE FROM bufrmoshpc WHERE location_id IN (SELECT DISTINCT id FROM bufrmos_location WHERE latitude > 90 or latitude < -90);"
${PSQL} -U awips -d metadata -c "DELETE FROM bufrmos_location WHERE latitude > 90 or latitude < -90;"
${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE bufrmosmrf;"
${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE bufrmoshpc;"
${PSQL} -U awips -d metadata -c "VACUUM FULL ANALYZE bufrmos_location;"