Trying to make return works

This commit is contained in:
Thomas Chevalier 2022-06-21 21:35:55 +02:00
parent fc462df120
commit d543557901

View file

@ -84,6 +84,8 @@ CREATE OR REPLACE FUNCTION INSERT_CT(
IN _ct_event integer
)
RETURNS bigint AS $$
DECLARE _id bigint;
BEGIN
INSERT INTO ulog2_ct (ct_id, oob_family, orig_ip_saddr_str, orig_ip_daddr_str, orig_ip_protocol,
orig_l4_sport, orig_l4_dport, orig_raw_pktlen, orig_raw_pktcount,
reply_ip_saddr_str, reply_ip_daddr_str, reply_ip_protocol,
@ -92,8 +94,10 @@ RETURNS bigint AS $$
flow_start_sec, flow_start_usec,
flow_end_sec, flow_end_usec, ct_event)
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24);
$1;
$$ LANGUAGE SQL SECURITY INVOKER;
_id = $1;
RETURN _id;
END
$$ LANGUAGE plpgsql SECURITY INVOKER;
CREATE OR REPLACE FUNCTION INSERT_OR_REPLACE_CT(
IN _ct_id integer,