Drop All Tables in a Postgress Database

  • May 28, 2010
  • By:
  • 0 Comment
  • Tech

I came across an interesting technique for dropping all the tables in a PostgreSQL Database without dropping the whole database.  Just drop this little piece of code into the database and the returning set is a list of sql that can be coppied and pasted right back into the database. [code]SELECT ‘DROP TABLE ‘||c.relname ||’ […]