-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathcreate-postgres-tables.sh
More file actions
executable file
·42 lines (34 loc) · 1.05 KB
/
Copy pathcreate-postgres-tables.sh
File metadata and controls
executable file
·42 lines (34 loc) · 1.05 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
37
38
39
40
41
42
#!/bin/bash
set -e
set -x
DUCKDB_PATH=duckdb
if test -f build/release/duckdb; then
DUCKDB_PATH=build/release/duckdb
elif test -f build/reldebug/duckdb; then
DUCKDB_PATH=build/reldebug/duckdb
elif test -f build/debug/duckdb; then
DUCKDB_PATH=build/debug/duckdb
fi
if [ -z "${PGSCANNERTMP_ABS_DIR_PREFIX}" ]; then
ABS_DIR_PREFIX="/tmp"
else
ABS_DIR_PREFIX="${PGSCANNERTMP_ABS_DIR_PREFIX//\\//}"
fi
echo "
CREATE SCHEMA tpch;
CREATE SCHEMA tpcds;
CALL dbgen(sf=0.01, schema='tpch');
CALL dsdgen(sf=0.01, schema='tpcds');
EXPORT DATABASE '${ABS_DIR_PREFIX}/postgresscannertmp';
" | \
$DUCKDB_PATH
dropdb --if-exists postgresscanner
createdb postgresscanner
psql -d postgresscanner < ${ABS_DIR_PREFIX}/postgresscannertmp/schema.sql
psql -d postgresscanner < ${ABS_DIR_PREFIX}/postgresscannertmp/load.sql
rm -rf ${ABS_DIR_PREFIX}/postgresscannertmp
psql -d postgresscanner < test/all_pg_types.sql
psql -d postgresscanner < test/decimals.sql
psql -d postgresscanner < test/other.sql
psql -d postgresscanner -c "CHECKPOINT"
psql -d postgresscanner -c "VACUUM"