postgresql/src/test
Alvaro Herrera b488c580ae Allow on-the-fly capture of DDL event details
This feature lets user code inspect and take action on DDL events.
Whenever a ddl_command_end event trigger is installed, DDL actions
executed are saved to a list which can be inspected during execution of
a function attached to ddl_command_end.

The set-returning function pg_event_trigger_ddl_commands can be used to
list actions so captured; it returns data about the type of command
executed, as well as the affected object.  This is sufficient for many
uses of this feature.  For the cases where it is not, we also provide a
"command" column of a new pseudo-type pg_ddl_command, which is a
pointer to a C structure that can be accessed by C code.  The struct
contains all the info necessary to completely inspect and even
reconstruct the executed command.

There is no actual deparse code here; that's expected to come later.
What we have is enough infrastructure that the deparsing can be done in
an external extension.  The intention is that we will add some deparsing
code in a later release, as an in-core extension.

A new test module is included.  It's probably insufficient as is, but it
should be sufficient as a starting point for a more complete and
future-proof approach.

Authors: Álvaro Herrera, with some help from Andres Freund, Ian Barwick,
Abhijit Menon-Sen.

Reviews by Andres Freund, Robert Haas, Amit Kapila, Michael Paquier,
Craig Ringer, David Steele.
Additional input from Chris Browne, Dimitri Fontaine, Stephen Frost,
Petr Jelínek, Tom Lane, Jim Nasby, Steven Singer, Pavel Stěhule.

Based on original work by Dimitri Fontaine, though I didn't use his
code.

Discussion:
  https://www.postgresql.org/message-id/m2txrsdzxa.fsf@2ndQuadrant.fr
  https://www.postgresql.org/message-id/20131108153322.GU5809@eldon.alvh.no-ip.org
  https://www.postgresql.org/message-id/20150215044814.GL3391@alvh.no-ip.org
2015-05-11 19:14:31 -03:00
..
examples Fix up .gitignore and cleanup actions in some src/test/ subdirectories. 2015-04-24 17:13:06 -04:00
isolation Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE. 2015-05-08 05:43:10 +02:00
locale Fix up .gitignore and cleanup actions in some src/test/ subdirectories. 2015-04-24 17:13:06 -04:00
mb Lots of doc corrections. 2012-04-23 22:43:09 -04:00
modules Allow on-the-fly capture of DDL event details 2015-05-11 19:14:31 -03:00
perl Fix previous commit for TAP test suites in VPATH builds. 2014-12-18 01:24:57 -05:00
regress Fix incorrect checking of deferred exclusion constraint after a HOT update. 2015-05-11 12:25:43 -04:00
ssl Make SSL regression test suite more portable by avoiding cp. 2015-04-09 22:07:18 +03:00
thread Fix up .gitignore and cleanup actions in some src/test/ subdirectories. 2015-04-24 17:13:06 -04:00
Makefile Fix up .gitignore and cleanup actions in some src/test/ subdirectories. 2015-04-24 17:13:06 -04:00