weird postgresql query runnning on aws postgres db
It looks like the kind of query that would be run by a DB management tool, such as PgAdmin or DBeaver, so that it can populate its navigation pane with a list of database objects or offer a context menu when a specific object has been drilled down into.  It does not appear to be malicious, although it is possible someone could be using such a tool maliciously.