Writing PL/PgSQL Scripts
PL/PgSQL Code in the Script Engine
Script Definition
DO $$
DECLARE
-- Variables can be declared here
BEGIN
-- SQL queries and operations can be executed here
END $$;Example: Update Timestamp
DO $$
DECLARE r timestamptz;
BEGIN
SELECT NOW() INTO r;
UPDATE heap SET ts = r WHERE asset_id = 1;
END$$;Last updated