-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstep-5.sh
More file actions
executable file
·37 lines (32 loc) · 1.93 KB
/
step-5.sh
File metadata and controls
executable file
·37 lines (32 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
clear
echo "STEP 5: Take a look at what happens when we change data"
echo "-- SELECT * FROM fica_status"
PGPASSWORD=postgres psql -P pager=off -U postgres -p 7432 -h localhost -d canonical_db -c 'SELECT * FROM fica_status;'
echo "-- SELECT * FROM fica_status_history"
PGPASSWORD=postgres psql -P pager=off -U postgres -p 7432 -h localhost -d canonical_db -c 'SELECT * FROM fica_status_history;'
echo ""
echo "-- Change some data in the fica_db.fica_status table"
echo "-- UPDATE fica_status SET status = 'compliant', changed_by = 'leona' WHERE name = 'mr big'"
PGPASSWORD=postgres psql -P pager=off -U postgres -p 9432 -h localhost -d fica_db -c "UPDATE fica_status SET status = 'compliant', changed_by = 'leona' WHERE name = 'mr big';"
#PGPASSWORD=postgres psql -P pager=off -U postgres -p 9432 -h localhost -d fica_db -c 'SELECT * FROM fica_status;'
#echo "look at the canonical db"
#PGPASSWORD=postgres psql -P pager=off -U postgres -p 7432 -h localhost -d canonical_db -c 'SELECT * FROM fica_status;'
echo "-- In the canonical_db"
echo "-- SELECT * FROM fica_status_history"
PGPASSWORD=postgres psql -P pager=off -U postgres -p 7432 -h localhost -d canonical_db -c 'SELECT * FROM fica_status_history;'
echo "-- Press ENTER"
read enter
clear
#PGPASSWORD=postgres psql -P pager=off -U postgres -p 7432 -h localhost -d canonical_db -c 'SELECT * FROM jibar;'
echo "-- And any changes made in jibar_db are reflected in the canonical_db"
echo "-- SELECT * FROM jibar_history"
PGPASSWORD=postgres psql -P pager=off -U postgres -p 7432 -h localhost -d canonical_db -c 'SELECT * FROM jibar_history;'
echo "-- Press ENTER"
read enter
clear
echo "-- For interest sake take a look at how jibar is defined in each database"
echo "-- jibar_db:jibar"
PGPASSWORD=postgres psql -P pager=off -U postgres -p 8432 -h localhost -d jibar_db -c '\d jibar;'
echo ""
echo "-- canonical:jibar"
PGPASSWORD=postgres psql -P pager=off -U postgres -p 7432 -h localhost -d canonical_db -c '\d jibar;'