0

In oracle, one can do a recovery from datafiles.

Does Postgres have an equivalent procedure?

I am already aware of the WAL files in Postgres, but I believe this is different. Datafiles in Oracle are the actual files on disk.

Data files are the operating system files that store the data within the database. The data is written to these files in an Oracle proprietary format that cannot be read by other programs

Does something like this exist for Postgres?

2
  • I am not sure what you are asking. For one, Postgres as a completely different disk layout. It is possible to re-use a complete data directory to start a new "instance", but I don't think this is what you are aiming at. What problem are you trying to solve?
    – user1822
    Mar 12, 2021 at 12:18
  • No particular problem, I was just curious if Postgres had such a concept. I know that ‘pg_dump’ exists and one can do PITR on a cluster, I just wanted to know if “datafile recovery” exists too.
    – J86
    Mar 12, 2021 at 12:21

1 Answer 1

1

PostgreSQL does not have datafiles in the same way as Oracle. PostgreSQL stores its contents in a directory (show data_directory;) and not in a tablespace that consists of 1 or more datafiles. You have no control over the naming and/or size of the files in there.

1
  • 2
    At the end of the day, all database systems store their data in a data file. The stucture of those files may vary, the placement and naming and oraganization may vary. The level of abstraction from the database may vary. But in the end, where else could it keep its data, if not in a (data) file? Your question mentions recovery, so if you are concerned about how to recover a Postgres database, you should just go straight to the Postgres docs on the subject and approach it with a clean mind instead of trying to make equivalency between the two systems.
    – EdStevens
    Mar 12, 2021 at 15:02

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.