When pgstream against Xata fails with permission denied for table pg_authid, switch the source to the xata user or set roles_snapshot_mode to no_passwords. When it fails with permission denied to set parameter session_replication_role, set disable_triggers to false in the target config or run the target as the xata user. Grant CREATE on the schema to the target role before transferring ownership.

Context: Official docs (pgstream xata guide): documents the gotcha that replicating to or from Xata with pgstream hits permission errors unless the roles are set up right. Roles with passwords need pg_authid access, so use the xata user as source or disable role passwords. Only the xata user can set session_replication_role, so set disable_triggers to false in the target config or use the xata user as target.