Reply to post: Wouldn't have helped here

If the thing you were doing earlier is 'drop table' commands, ctrl-c, ctrl-v is not your friend

juice

Wouldn't have helped here

DROP TABLE is a DDL[*] command, so can't be rolled back.

And before anyone goes snarking on MySQL (which is usually a valid target TBF), it's the same in Oracle. To quote asktom (https://asktom.oracle.com/pls/apex/asktom.search?tag=ddl-rollback):

> Oracle Database issues an implicit commit before and after any DDL statement ... this means even if the DDL fails, the preceding DML is still committed

So you can end up with a right mess if you attempt to combine DDL and DML in a single transaction which has a failure partway through.

Interestingly, SQL Server appears to support transactional DDL commands. Dunno about Postgres, since it's virtual Monday and I've pretty much run out of energy and caffeine...

[*]DDL: Data Definition Language - essentially, commands which control the structure which holds the data. Unlike DML (Data Manipulation Language) which is used to query and/or change the data held within the structure

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon