Nathan30 Nathan30 - 1 year ago 76
Linux Question

Revert insert into postgres database

I failed while creating a script to insert data into a database. I forgot to connect to my database before insert (I was connected into postgres database, in order to create mine), so all my tables are now in the postgres database.

How could I remove all this table ? Is it possible to remove tables by owner, or something ?

Thanks in advance

Answer Source

You can use DROP OWNED BY as long as you are sure that you want to delete all objects owned by that user.

Otherwise you'll have to do it by hand, which should be simple since the database postgres is normally empty.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download