Re: Support logical replication of DDLs - Mailing list pgsql-hackers

From Jonathan S. Katz
Subject Re: Support logical replication of DDLs
Date
Msg-id d18b6fcd-6a93-63d7-6db7-8c0934b1ca67@postgresql.org
Whole thread Raw
In response to Re: Support logical replication of DDLs  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: Support logical replication of DDLs  ("Jonathan S. Katz" <jkatz@postgresql.org>)
Re: Support logical replication of DDLs  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
On 2/16/23 2:38 PM, Alvaro Herrera wrote:
> On 2023-Feb-16, Jonathan S. Katz wrote:
> 
>> On 2/16/23 12:53 PM, Alvaro Herrera wrote:
> 
>>> I don't think this is the fault of logical replication.  Consider that
>>> for the backend server, the function source code is just an opaque
>>> string that is given to the plpgsql engine to interpret.  So there's no
>>> way for the logical DDL replication engine to turn this into runnable
>>> code if the table name is not qualified.
>>
>> Sure, that's fair. That said, the example above would fall under a "typical
>> use case", i.e. I'm replicating functions that call tables without schema
>> qualification. This is pretty common, and as logical replication becomes
>> used for more types of workloads (e.g. high availability), we'll definitely
>> see this.
> 
> Hmm, I think you're saying that replay should turn check_function_bodies
> off, and I think I agree with that.

Yes, exactly. +1

The docs seem to think that is the correct approach too:

"Set this parameter to off before loading functions on behalf of other 
users"[1].

[1] 
https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-CHECK-FUNCTION-BODIES


Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Support logical replication of DDLs
Next
From: Nathan Bossart
Date:
Subject: Re: recovery modules