Re: Is there a way to detect that code is inside CREATE EXTENSION? - Mailing list pgsql-general

From Michel Pelletier
Subject Re: Is there a way to detect that code is inside CREATE EXTENSION?
Date
Msg-id CACxu=v+pNTdh7FvnXjAwwj90HNJsfkgLnFkuUhBxxF7F_rqbZQ@mail.gmail.com
Whole thread Raw
In response to Re: Is there a way to detect that code is inside CREATE EXTENSION?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general


At the C-code level you can check the creating_extension global variable,
or maybe better look at the in_extension fields of CollectedCommands.

Thanks Tom!

That was the hint I needed, looks like pg_event_trigger_ddl_commands() has an in_extension boolean that seems like it will do what I need?   If I understand you correctly that's what you're referring to with CollectedCommands.   Testing it now but that looks like the answer for me, if any of those are true then I can just skip the regeneration. 

-Michel

pgsql-general by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: Is there a way to detect that code is inside CREATE EXTENSION?
Next
From: Shaozhong SHI
Date:
Subject: Re: print in plpython not appearing in logs