0

I have not done anything. I just run this command DELETE FROM feed_republic. But I want to get my data again. What should I do?

When I run rollback I am getting the following message. Please help!

WARNING:  there is no transaction in progress

I have not used any commit or any other command unlike this question Can I rollback a transaction I've already committed? (data loss).

8
  • 1
    Possible duplicate of Restore deleted records in PostgreSQL Commented Mar 14, 2019 at 6:28
  • You can't rollback a transaction that is already committed. Commented Mar 14, 2019 at 6:29
  • I have not used commit command. So, my database is commited ot not? Commented Mar 14, 2019 at 6:32
  • 1
    I'm afraid, there's no straightforward way to bring data back. I hope you have not done that in production. I believe you're new to Postgres. It's not like Oracle that by default dmls can be rolled back when run as a single statement. In Postgres, a statement is automatically committed unless you're running those inside a transaction, starting with BEGIN; Commented Mar 14, 2019 at 6:32
  • It's committed. You performed your operation outside the scope of a transaction, so it's committed automatically. Commented Mar 14, 2019 at 6:33

1 Answer 1

1

PostgreSQL is running in autocommit mode, so every statement is running in its own transaction unless you explicitly start a transaction with BEGIN or START TRANSACTION.

The only way you can get your data back is by restoring from a backup.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.