Files
secondo/Tools/Generators/TPC-H/postgres/import_tbls.sh

32 lines
542 B
Bash
Raw Permalink Normal View History

2026-01-23 17:03:45 +08:00
#!/bin/sh
#
# 06.02.2006 Create TPC-H tables in a postgres
# database and import the tabel data from files.
db="$1"
dataDir="$2"
if [ "$db" == "" ]; then
echo "Error: no database specified!"
exit 1
fi
if [ "$dataDir" == "" ]; then
dataDir=$PWD
fi
# import data
echo -e "\n *** Importing data from $dataDir into database $db ... *** \n"
for table in $dataDir/*.tbl.pg; do
basename=${table##*/}
rel=${basename%.tbl.pg}
echo "COPY $rel FROM '$table' WITH DELIMITER AS
'|'" | psql -d $db -e
done
vacuumdb -ef -d $db
exit $?