At Fri, 9 Jul 2021 10:49:46 -0600, Jeff Ross <jross@openvistas.net> wrote in
> Hello,
>
> I'm working with an RDS instance running 12 that has an old
> subscription that I can't seem to drop.
...
> It shows up here:
>
> mirror_admin@metro_logical> select * from pg_subscription;
> oid │ subdbid │ subname │ subowner │ ...
> ────┼─────┼─────────┼─────┼ ...
> 83645 │ 66754 │ cargowel_common │ 16394 │ ...
> 83646 │ 66754 │ metro_prod │ 16394 │ ...
> 51490 │ 14313 │ metro │ 16394 │ ...
> (3 rows)
...
> But not in here:
>
> mirror_admin@metro_logical> \dRs+
> List of subscriptions
> Name │ Owner │ Enabled │ Publication
> ─────────┼───────┼─────┼───────────
> cargowel_common │ mirror_admin │ t │ {cargowel_common_prod}
> metro_prod │ mirror_admin │ t │ {metro_prod}
> (2 rows)
>
> And it can't be disabled or dropped:
Look at the subdbid field in the first query result. You were logging
into the databsae with OID=66754 and the subscription "metro" belongs
to the database 14313. The second command doesn't show metro which is
not of the current database.
> mirror_admin@metro_logical> alter subscription metro disable;
> ERROR: subscription "metro" does not exist
> Time: 24.263 ms
> mirror_admin@metro_logical> drop subscription metro;
> ERROR: subscription "metro" does not exist
> Time: 23.648 ms
>
> I did try deleting it directly from the pg_subscription table but that
> failed with a permission denied error. My suspicion is that's because
> of the RDS environment.
>
> What else can I try to remove this old non-functional subscription?
Thus you need to log in to the databse OID=14313 to manipulate on the
subsciption metro.
regards.
--
Kyotaro Horiguchi
NTT Open Source Software Center