Skip to content

Commit 6ba9ec7

Browse files
committed
wip
Former-commit-id: ce17d85
1 parent 765fb92 commit 6ba9ec7

File tree

3 files changed

+33
-12
lines changed

3 files changed

+33
-12
lines changed

test/add-schema.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
psql -U u1 -h localhost -d db1 >/dev/null <<EOS
3+
$1
4+
EOS
5+

test/start-fresh.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
sudo su - postgres -- <<EOT
4+
psql <<'SQL'
5+
DROP DATABASE IF EXISTS db1;
6+
DROP DATABASE IF EXISTS db2;
7+
DROP USER IF EXISTS u1;
8+
CREATE USER u1 WITH SUPERUSER PASSWORD 'asdf';
9+
CREATE DATABASE db1 WITH OWNER = u1 TEMPLATE = template1;
10+
CREATE DATABASE db2 WITH OWNER = u1 TEMPLATE = template1;
11+
SQL
12+
EOT
13+

test/test-table.sh

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33
# Useful for visually inspecting the output SQL to verify it is doing what it should
44
#
55

6-
sudo su - postgres -- <<EOT
7-
psql <<'SQL'
8-
DROP DATABASE IF EXISTS db1;
9-
DROP DATABASE IF EXISTS db2;
10-
DROP USER IF EXISTS u1;
11-
CREATE USER u1 WITH SUPERUSER PASSWORD 'asdf';
12-
CREATE DATABASE db1 WITH OWNER = u1 TEMPLATE = template1;
13-
CREATE DATABASE db2 WITH OWNER = u1 TEMPLATE = template1;
14-
SQL
15-
EOT
6+
source ./start-fresh.sh >/dev/null
7+
8+
#sudo su - postgres -- <<EOT
9+
#psql <<'SQL'
10+
# DROP DATABASE IF EXISTS db1;
11+
# DROP DATABASE IF EXISTS db2;
12+
# DROP USER IF EXISTS u1;
13+
# CREATE USER u1 WITH SUPERUSER PASSWORD 'asdf';
14+
# CREATE DATABASE db1 WITH OWNER = u1 TEMPLATE = template1;
15+
# CREATE DATABASE db2 WITH OWNER = u1 TEMPLATE = template1;
16+
#SQL
17+
#EOT
1618
export PGPASSWORD=asdf
1719

1820
echo
@@ -21,15 +23,16 @@ echo "# Compare the tables in two schemas in the same database"
2123
#
2224
# Compare the tables in two schemas in the same database
2325
#
24-
psql -U u1 -h localhost -d db1 <<'EOS'
26+
#psql -U u1 -h localhost -d db1 <<'EOS'
27+
./add-schema.sh "
2528
CREATE SCHEMA s1;
2629
CREATE TABLE s1.table9 (id integer); -- to be added to s2
2730
CREATE TABLE s1.table10 (id integer);
2831
2932
CREATE SCHEMA s2;
3033
CREATE TABLE s2.table10 (id integer);
3134
CREATE TABLE s2.table11 (id integer); -- will be dropped from s2
32-
EOS
35+
"
3336

3437

3538
echo

0 commit comments

Comments
 (0)