Skip to content

Commit 820ca85

Browse files
authored
Merge pull request #1751 from craigcomstock/ENT-5562/master
ENT-5562 Changed m_inventory dumping behavior to exclude when values is null (3.12.x)
2 parents c0a1d67 + 65cd6c4 commit 820ca85

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • templates/federated_reporting

templates/federated_reporting/dump.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ log "Dumping tables: $CFE_FR_TABLES"
5858

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

0 commit comments

Comments
 (0)