Anyone familiar with triggers? I get a syntax error and im not sure what is wrong on line 2. First time creating a trigger.

CREATE TRIGGER trig_check_geometry
ON pipeline.tek_water_area AFTER INSERT, UPDATE
AS
BEGIN
IF EXISTS (
SELECT *
FROM inserted
WHERE geometry_column.STIsValid() = 0
)
BEGIN
RAISERROR ('Invalid geometry detected. Please insert valid geometries only.', 16, 1);
ROLLBACK TRANSACTION;
END
END
Follow

@Shlomo If you're running straight SQL, you shouldn't. I don't know anything about pgadmin4.

· · Web · 0 · 0 · 0
Sign in to participate in the conversation
Merovingian Club

A club for red-pilled exiles.