pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jonathan S. Katz <jkatz@postgresql.org>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: houzj.fnst@fujitsu.com <houzj.fnst@fujitsu.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Ajin Cherian <itsajin@gmail.com>
Cc: Peter Smith <smithpb2250@gmail.com>
Cc: vignesh C <vignesh21@gmail.com>
Cc: Zheng Li <zhengli10@gmail.com>
Cc: li jie <ggysxcq@gmail.com>
Cc: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Japin Li <japinli@hotmail.com>
Cc: rajesh singarapu <rajesh.rs0541@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Support logical replication of DDLs
Date: Thu, 16 Feb 2023 14:43:16 -0500
Message-ID: <d18b6fcd-6a93-63d7-6db7-8c0934b1ca67@postgresql.org> (raw)
In-Reply-To: <20230216193827.h4p6dtjg244ox5fj@alvherre.pgsql>
References: <20230216193827.h4p6dtjg244ox5fj@alvherre.pgsql>

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



Attachments:

  [application/pgp-signature] OpenPGP_signature (839B, ../d18b6fcd-6a93-63d7-6db7-8c0934b1ca67@postgresql.org/2-OpenPGP_signature)
  download

view thread (449+ messages)  latest in thread

Message-ID: <d18b6fcd-6a93-63d7-6db7-8c0934b1ca67@postgresql.org>
Permalink:  ../d18b6fcd-6a93-63d7-6db7-8c0934b1ca67@postgresql.org/
Also on:    postgresql.org/message-id/d18b6fcd-6a93-63d7-6db7-8c0934b1ca67@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-general@postgresql.org
  Cc: jkatz@postgresql.org, alvherre@alvh.no-ip.org, houzj.fnst@fujitsu.com, amit.kapila16@gmail.com, itsajin@gmail.com, smithpb2250@gmail.com, vignesh21@gmail.com, zhengli10@gmail.com, ggysxcq@gmail.com, dilipbalaut@gmail.com, sawada.mshk@gmail.com, japinli@hotmail.com, rajesh.rs0541@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Support logical replication of DDLs
  In-Reply-To: <d18b6fcd-6a93-63d7-6db7-8c0934b1ca67@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox