Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement - Mailing list pgsql-hackers

From Philip Alger
Subject Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
Date
Msg-id CAPXBC8KVpwSLc1j8wTmVsnnYdqBm3kH0cn43JZr6HFMZ88OFXw@mail.gmail.com
Whole thread
In response to Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement  (Soumya S Murali <soumyamurali.work@gmail.com>)
Responses Re: [PATCH] Add pg_get_trigger_ddl() to retrieve the CREATE TRIGGER statement
List pgsql-hackers
Hi Hackers, 

Updated the pg_get_trigger_ddl() patch to align with the other pg_get_*_ddl functions that are committed. I moved the function out of the relutils.c file to the ddlutils.c file and moved the tests to TAP tests as well. In this patch, pretty printing is introduced and functional, similar to the other DDL functions. 

Overall, it's quite a change. Previously I used pg_get_triggerdef to capture the DDL output. However, this proved to be difficult since there isn't the dame pretty functionality that exists with other functions like pg_get_viewdef. Therefore, instead of trying to add pretty-printing capability to the triggerdef function or creating a similar function that duplicates code, I take the output of triggerdef as a string and parse it across multiple lines to achieve the pretty-printing output.

--
Best,
Phil Alger
Attachment

pgsql-hackers by date:

Previous
From: Antonin Houska
Date:
Subject: Re: Unexpected changes of CurrentResourceOwner and CurrentMemoryContext
Next
From: "Daniel Westermann (DWE)"
Date:
Subject: Deprecation warnings on Rocky 10.2 with current dev branch