Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CREATE OR REPLACE FUNCTION public.jhu_county_watched()
RETURNS trigger AS
$BODY$
DECLARE
BEGIN
PERFORM pg_notify('jhucounty', '{"type": "Feature", "geometry": ' ||
st_asgeojson(NEW.wkb_geometry) ||
',"properties": {"message": "' ||
'update' || '",' ||
'"fips": "' || NEW.fips || '",' ||
'"label": "' || NEW.combined_key || '",' ||
'"confirmed": "' || NEW.confirmed || '",' ||
'"last_update": "' || NEW.last_update || '"' ||
'}}' );
RETURN new;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION public.jhu_county_watched()
OWNER TO postgres;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.