[GENERAL] ERROR: invalid input syntax for integer: "INSERT" - Mailing list pgsql-general

From Robert Lakes
Subject [GENERAL] ERROR: invalid input syntax for integer: "INSERT"
Date
Msg-id CAHnqRj15zmq86NaHkTL5y-pxsbUko0pYC484t1EE+UDzCBL_YA@mail.gmail.com
Whole thread Raw
Responses Re: [GENERAL] ERROR: invalid input syntax for integer: "INSERT"
List pgsql-general
Guys,
New to Postgres - here's my code inside an event trigger:
ELSIF (TG_OP = 'INSERT') THEN
        EXECUTE format('INSERT INTO %I SELECT statement_timestamp(), ''INSERT'', $1.*', TG_TABLE_NAME || '_cdc')
        USING NEW;
        RETURN NEW;


Here's the error I am receiving - when I am attempting to insert a record into a table:

ERROR:  invalid input syntax for integer: "INSERT"
LINE 1: ...T INTO listings_cdc SELECT statement_timestamp(), 'INSERT', ...
                                                             ^
QUERY:  INSERT INTO listings_cdc SELECT statement_timestamp(), 'INSERT', $1.*
CONTEXT:  PL/pgSQL function audit_func() line 28 at EXECUTE

pgsql-general by date:

Previous
From: Mark Fletcher
Date:
Subject: [GENERAL] pg_logical/snapshots directory
Next
From: "David G. Johnston"
Date:
Subject: Re: [GENERAL] ERROR: invalid input syntax for integer: "INSERT"