Skip to main content

drop all the table in a 3-node cluster (say 800 tables)

  • February 14, 2015
  • 3 replies
  • 13 views

Amit_Singh
drop all the table in a 3-node cluster (say 800 tables)

3 replies

Ben_Vandiver
Forum|alt.badge.img
  • Participating Frequently
  • February 15, 2015
I like the vsql-to-vsql approach:

vsql -aT -c "select 'drop table '||table_name||' cascade;' from tables" | vsql

id10t
Forum|alt.badge.img
  • Participating Frequently
  • February 15, 2015
did you mean(mistype)? :)
 
vsql -At -c "select 'drop table '||table_name||' cascade;' from tables" | vsql

because:
$ vsql --help | grep -P '(\-T)|(\-a)'
-a echo all input from script
-T TEXT set HTML table tag attributes (width, border) (-P tableattr=)


Ben_Vandiver
Forum|alt.badge.img
  • Participating Frequently
  • February 15, 2015
Err.. yup.  Flipped the case.  Thanks!