Creating a trigger for child table insertion returns confusing error
I am trying to write a trigger function that will input values into separate child tables, however I am getting an error I have not seen before. Here is an example set up: -- create initial table CREATE TABLE public.testlog( id serial not null, col1 integer, col2 integer, col3 integer, name text ); -- create child table CREATE TABLE public.testlog_a (primary key(id)) INHERITS(public.testlog); -- make trigger function for insert CREATE OR REPLACE FUNCTION public.test_log() RETURNS trigger AS $$ DECLARE qry text; BEGIN qry := 'INSERT INTO public.testlog_' || NEW.name || ' SELECT ($1).*'; EXECUTE