Options

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

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

Comments

  • Options
    If it's all of the tables, it might easier to just to drop the entire schema and re-create it!

    DROP SCHEMA xxx CASCADE;

    CREATE SCHEMA xxx;


  • Options
    I like the vsql-to-vsql approach:

    vsql -aT -c "select 'drop table '||table_name||' cascade;' from tables" | vsql
  • Options
    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=)

  • Options
    Err.. yup.  Flipped the case.  Thanks!

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file