You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While formatting code with pg_format facing issue when my query use EXCEPTION block for trigger. Can someone please help here? I'm missing anything here?
Before format:
After format:
Code:
CREATE OR REPLACE FUNCTION trigger_before_insert_tg_name ()
RETURNS TRIGGER
AS $$
BEGIN
-- do some operation
-- Check if the resource_type is list of monitored resources
RETURN NEW;
EXCEPTION
-- Catch any errors that occur in the trigger
WHEN OTHERS THEN
-- Optionally log the error to another table or perform some action
RAISE WARNING 'Trigger failed: %', SQLERRM;
-- Continue without interrupting the original INSERT
RETURN NEW;
END;
The text was updated successfully, but these errors were encountered:
While formatting code with pg_format facing issue when my query use EXCEPTION block for trigger. Can someone please help here? I'm missing anything here?
Before format:
After format:
Code:
The text was updated successfully, but these errors were encountered: