Sample script to performs a VACUUM of the Greenplum Database system catalog

Post date: Mar 14, 2014 12:56:18 AM

#!/bin/bash

DBNAME="<database_name>"

VCOMMAND="VACUUM ANALYZE"

psql -tc "select '$VCOMMAND' || ' pg_catalog.' || relname || ';' from pg_class a,pg_namespace b where a.relnamespace=b.oid and b.nspname= 'pg_catalog' and a.relkind='r'" $DBNAME | psql -a $DBNAME