File size is identical, /var/lib one is as you say postgres:postgres 100644, but /opt/rockstor is root:root and 100644
PG version shows 17 and directory listing permissions are identical as yours, only thing is that ls or cat /var/lib/pgsql/data works only as root (viewing). Not sure it means anything.
100600 to be correct, not that it probably matters… what are my options ? Can I (temporary) downgrade to rockstor 5.1.0 and postgresql13 ? Or use somehow (snapshot ?) features of btrfs (I have root also btfrs) ?
Can you also check whether the files below the ./pg_wal directory have postgres as the owner (I assume they do)?
I am not sure about the downgrading back to 5.1.0 without a clean install, as db migrations have likely already occurred (like adding a new field, etc.) initiated by Django, which would complicate things.
You have not performed a Rockstor configuration backup recently, correct? Otherwise, it would be easiest to just reinstall and apply the configuration back after importing your data pool(s) following the Rockstor documentation.
I tried to convert database back from 17 → 13 and it kind of worked (means PostgreSQL13 service is working). Now how to do rockstor 5.5 to 5.1 (to test does it really work) ?
Is the database accessible with the username/password (like with the above mentioned example)?
In general, you can ask zypper to install a specific version (and possibly even force it), though I am not sure about the implications, if you still have remaining items from 5.5 sitting around. I suspect, you would have to still perform the directory removal as @phillxnet mentioned.
But I certainly have not tried this, so YMMV.