Skip to content

Instantly share code, notes, and snippets.

@blkperl
Created August 13, 2013 08:16
Show Gist options
  • Select an option

  • Save blkperl/6218966 to your computer and use it in GitHub Desktop.

Select an option

Save blkperl/6218966 to your computer and use it in GitHub Desktop.
#!/bin/sh
RUBYOPT='-W0'
export RUBYOPT
su - postgres <<ENDOFSU
psql puppetdb <<ENDOFPS
delete from catalogs where hash in ( select catalog from catalog_resources where title like '%$1%' );
delete from certname_facts_metadata where certname = '$1';
delete from certname_facts where certname = '$1';
delete from certnames where name = '$1';
ENDOFPS
ENDOFSU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment