运行触发器并尝试运行以下函数时出现错误
CREATE OR REPLACE FUNCTION insert_new_sessions()
RETURNS trigger AS
$$
DECLARE
BEGIN
SELECT dblink_exec('dbname=billing port=5432','INSERT INTO md.radacct_test(radacctid,acctsessionid,acctuniqueid,username) select New.radacctid,New.acctsessionid,New.acctuniqueid,New.username' );
RETURN NULL;
EXCEPTION WHEN OTHERS THEN RAISE NOTICE 'insert_new_sessions SQL ERROR: %', SQLERRM;
RETURN NULL;
END;
$$ LANGUAGE plpgsql;
错误:
ERROR insert_new_sessions SQL ERROR: missing FROM-clause entry for table "new"