I have a table private.products and a view public.products representing that table. And I want to create entries in private.products while inserting into view, it all works right, except that I also what to return the inserted id:
CREATE RULE insert_product
AS ON INSERT TO public.products DO INSTEAD
INSERT INTO private.products (name) VALUES (new.name) RETURNING products.id;
ERROR: RETURNING list has too few entries
What am I doing wrong?