I took a backup of the Postgres database version 15, and now I want to restore that data to Postgres version 13.1.2? is it possible?
It is not supported to downgrade PostgreSQL, no matter what.
The only way to success is the following cumbersome route:
Take a plain-format dump with
pg_dump -f dump.sql dbname
You need to use
pg_dumpfrom version 15 for that
Try to restore the dump to version 13 using
psql. That will fail. Look at the error messages and edit
dump.sql, manually changing the SQL syntax to avoid the error. Then try to restore again, and so on until all errors are gone.
I hope 13.1.2 is a typo, and you mean 13.12.