Re: replicating DROP commands across servers

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, "Brightwell, Adam" <adam(dot)brightwell(at)crunchydatasolutions(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: replicating DROP commands across servers
Date: 2014-10-03 18:21:12
Message-ID: 542EE918.2030406@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/03/2014 09:06 PM, Alvaro Herrera wrote:
> Heikki Linnakangas wrote:
>
>> I had a very brief look at the docs, and these extra outputs from
>> pg_event_trigger_dropped_objects caught my eye:
>>
>>> + <row>
>>> + <entry><literal>address_names</literal></entry>
>>> + <entry><type>text[]</type></entry>
>>> + <entry>
>>> + An array that, together with <literal>address_args</literal>,
>>> + can be used by the C-language function getObjectAddress() to
>>> + recreate the object address in a remote server containing a similar object.
>>> + </entry>
>>> + </row>
>>> + <row>
>>> + <entry><literal>address_args</literal></entry>
>>> + <entry><type>text[]</type></entry>
>>> + <entry>
>>> + See <literal>address_names</literal> above.
>>> + </entry>
>>> + </row>
>>
>> I couldn't find a function called getObjectAddress anywhere. Typo?
>
> Ah, yeah, it's get_object_address actually.
>
>> Also, is providing a C-language function the best we can do? The
>> rest of the information returned by pg_event_trigger_dropped_objects
>> is usable from any language.
>
> Well, the return value from get_object_address is an ObjectAddress.
> It's simple enough to create an SQL wrapper that takes the
> address_names/address_args arrays and return an ObjectAddress; would
> this be useful?

An ObjectAddress consists of a classid, objid, and objsubid.
pg_event_trigger_dropped_objects already returns all of those as
separate fields. What am I missing?

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Arthur Silva 2014-10-03 18:30:35 Re: Fixed xloginsert_locks for 9.4
Previous Message Bruce Momjian 2014-10-03 18:19:20 Re: [RFC] Incremental backup v2: add backup profile to base backup