Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion templates/federated_reporting/dump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ log "Dumping tables: $CFE_FR_TABLES"

# in case of 3.12 must copy m_inventory as if it was __inventory
if [[ "$CFE_VERSION" =~ "3.12." ]]; then
"$CFE_BIN_DIR"/psql cfdb -c "COPY (SELECT * FROM m_inventory) TO STDOUT CSV QUOTE '''' FORCE QUOTE *" |
# pg_dump will not dump the contents of views so we must run the following SQL:
"$CFE_BIN_DIR"/psql cfdb -c "COPY (SELECT * FROM m_inventory WHERE values IS NOT NULL) TO STDOUT CSV QUOTE '''' FORCE QUOTE *" |
sed -e 's.^.INSERT INTO __inventory (hostkey, values) VALUES (.' \
-e 's.$.);.'
fi
Expand Down