Skip to content

Commit d3d75af

Browse files
committed
added some utility scripts
1 parent 635b619 commit d3d75af

File tree

5 files changed

+46
-0
lines changed

5 files changed

+46
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ node_modules
44
logs
55
*.log
66
npm-debug.log*
7+
#kyle
8+
downloads/*.csv
9+
.DS_Store
10+
tmp*
711

812
# Runtime data
913
pids

scripts/counts.sql

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
SELECT schemaname,relname,n_live_tup
2+
FROM pg_stat_user_tables
3+
ORDER BY n_live_tup DESC;
4+
5+
6+
7+
-- schemaname | relname | n_live_tup
8+
-- ------------+---------------+------------
9+
-- public | VeteranWar | 1416946
10+
-- public | VeteranBranch | 1321561
11+
-- public | Veterans | 1311435
12+
-- public | Kins | 1311195
13+
-- public | Burials | 1310093
14+
-- public | VeteranRank | 1309348
15+
-- public | Ranks | 15394
16+
-- public | Branches | 74
17+
--
18+
-- public | Cemeteries | 44
19+
-- public | Wars | 21

scripts/createVAdatabase.sql

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- Database: va
2+
3+
-- DROP DATABASE va;
4+
5+
CREATE DATABASE va
6+
WITH
7+
OWNER = "postgres"
8+
ENCODING = 'UTF8'
9+
LC_COLLATE = 'en_US.UTF-8'
10+
LC_CTYPE = 'en_US.UTF-8'
11+
TABLESPACE = pg_default
12+
CONNECTION LIMIT = -1;

scripts/droptables.sql

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP TABLE "VeteranWar", "VeteranBranch", "Veterans", "Kins", "Burials", "VeteranRank", "Ranks", "Branches","Cemeteries", "Wars";

scripts/empty.sql

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- TRUNCATE "VeteranWar" CASCADE;
2+
-- TRUNCATE "VeteranBranch" CASCADE;
3+
-- TRUNCATE "Veterans" CASCADE;;
4+
-- TRUNCATE "Kins" CASCADE;
5+
-- TRUNCATE "Burials" CASCADE;
6+
-- TRUNCATE "VeteranRank" CASCADE;
7+
-- TRUNCATE "Ranks" CASCADE;
8+
-- TRUNCATE "Branches" CASCADE;
9+
TRUNCATE "Cemeteries" ;
10+
-- TRUNCATE "Wars" CASCADE;

0 commit comments

Comments
 (0)