How to extract information from pg_ddl_command type

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: How to extract information from pg_ddl_command type
Date: 2019-07-11 07:27:11
Message-ID: qg6ocf$ikd$1@blaine.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The function pg_event_trigger_ddl_commands() returns several columns, one of them being "command" that is of the type "pg_ddl_command".

The manual[1] describes this column as:

> A complete representation of the command, in internal format.
> This cannot be output directly, but it can be passed to other
> functions to obtain different pieces of information about the
> command.

However, I can not find any of those "other functions" to extract information from that column.

My goal is to get the complete SQL text that fired the event trigger - is that even possible through pg_event_trigger_ddl_commands()?

Thanks
Thomas

[1] https://www.postgresql.org/docs/current/functions-event-triggers.html

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gavin Flower 2019-07-11 08:17:14 Re: migrating from Oracle to PostgreSQL 11
Previous Message Hitesh Chadda 2019-07-11 05:53:06 Re: migrating from Oracle to PostgreSQL 11