Postgres GROUP BY id works on table directly, but not on identical view
The problem appears because Postgres knows that table t has (id) as the primary key - so we can use GROUP BY t.id and have more columns from that table in the SELECT list without aggregating them - but it can't infer the same for view vt.

For the examples provided, you can rewrite them as not to use GROUP BY at all. Since you don't need any column from the second joined table in the select list, you can convert the JOIN to an EXISTS subquery, i.e. convert the join to a semi-join. Now both the tables and views semijoin work without errors:

SELECT row_to_json(t.*) as "t_group" FROM t
WHERE t.id = 1 
  AND EXISTS 
      ( SELECT 1 
        FROM y 
        WHERE t.id = y.tid
          AND y.amount &gt; 1 
      ) ;

SELECT row_to_json(vt.*) as "t_group" FROM vt
WHERE vt.id = 1 
  AND EXISTS 
      ( SELECT 1 
        FROM vy 
        WHERE vt.id = vy.tid
          AND vy.amount &gt; 1 
      ) ;