public inbox for [email protected]
help / color / mirror / Atom feedRe: Regarding: Replication of TRUNCATE commands is not working
2+ messages / 2 participants
[nested] [flat]
* Re: Regarding: Replication of TRUNCATE commands is not working
@ 2024-04-09 12:07 Arvind Raghuwanshi <[email protected]>
2024-04-09 14:28 ` Re: Regarding: Replication of TRUNCATE commands is not working Adrian Klaver <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Arvind Raghuwanshi @ 2024-04-09 12:07 UTC (permalink / raw)
To: Laurenz Albe <[email protected]>; +Cc: [email protected]
Hi Laurenz,
Thanks for the response
Question: What PostgreSQL version are you using? The feature was
introduced in v11.
Answer: I am using the 16.0 Postgresql version.
db1=> SELECT version();
version
-----------------------------------------------------------------------------------------------------
PostgreSQL 16.0 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu
7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
(1 row)
Question: How exactly is the publication defined? Perhaps TRUNCATE is
excluded.
I am not using the subscribe/publication model . but i have created a
replication slot on the source database and then i am calling below
procedure to get the details from replication slot:
select data from pg_logical_slot_peek_changes('db1_slot', NULL, NULL,
'pretty-print', '1');
In the case of TRUNCATE , the above procedure does not show up any records.
however this procedure shows up insert, update and delete events.
As you mentioned TRUNCATE is excluded, is there any way to exclude
TRUNCATE ?
Thanks
Arvind
On Tue, Apr 9, 2024 at 4:08 PM Laurenz Albe <[email protected]>
wrote:
> On Tue, 2024-04-09 at 14:50 +0530, Arvind Raghuwanshi wrote:
> > I have tried to run the TRUNCATE command and found out that it's not
> getting replicated using logical replication for pgsql.
> > I have also checked the schema change using pg_dump command but the
> schema change also not getting detected for TRUNCATE command.
> >
> > However on pgsql logical replication doc page[1] , it's mentioned
> that Replication of TRUNCATE commands is supported.
> >
> > [1] PostgreSQL: Documentation: 16: 31.6. Restrictions
> >
> > Any idea how we can solve this?
>
> What PostgreSQL version are you using? The feature was introduced in v11.
> How exactly is the publication defined? Perhaps TRUNCATE is excluded.
>
> Yours,
> Laurenz Albe
>
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Regarding: Replication of TRUNCATE commands is not working
2024-04-09 12:07 Re: Regarding: Replication of TRUNCATE commands is not working Arvind Raghuwanshi <[email protected]>
@ 2024-04-09 14:28 ` Adrian Klaver <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Adrian Klaver @ 2024-04-09 14:28 UTC (permalink / raw)
To: Arvind Raghuwanshi <[email protected]>; Laurenz Albe <[email protected]>; +Cc: [email protected]
On 4/9/24 05:07, Arvind Raghuwanshi wrote:
> Hi Laurenz,
> Thanks for the response
> Question: What PostgreSQL version are you using? The feature was
> introduced in v11.
> Answer: I am using the 16.0 Postgresql version.
> db1=> SELECT version();
> version
> -----------------------------------------------------------------------------------------------------
> PostgreSQL 16.0 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu
> 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit
> (1 row)
>
> Question: How exactly is the publication defined? Perhaps TRUNCATE is
> excluded.
> I am not using the subscribe/publication model . but i have created a
To be clear you have not done CREATE PUBLICATION on the source machine,
correct?
What is the rest of your configuration per:
https://www.postgresql.org/docs/current/logical-replication-config.html
Also what exactly is being TRUNCTEd?
> replication slot on the source database and then i am calling below
> procedure to get the details from replication slot:
> select data from pg_logical_slot_peek_changes('db1_slot', NULL, NULL,
> 'pretty-print', '1');
>
> In the case of TRUNCATE , the above procedure does not show up any
> records. however this procedure shows up insert, update and delete events.
>
> As you mentioned TRUNCATE is excluded, is there any way to exclude
> TRUNCATE ?
>
> Thanks
> Arvind
>
> On Tue, Apr 9, 2024 at 4:08 PM Laurenz Albe <[email protected]
> <mailto:[email protected]>> wrote:
>
> On Tue, 2024-04-09 at 14:50 +0530, Arvind Raghuwanshi wrote:
> > I have tried to run the TRUNCATE command and found out that it's
> not getting replicated using logical replication for pgsql.
> > I have also checked the schema change using pg_dump command but
> the schema change also not getting detected for TRUNCATE command.
> >
> > However on pgsql logical replication doc page[1] , it's mentioned
> that Replication of TRUNCATE commands is supported.
> >
> > [1] PostgreSQL: Documentation: 16: 31.6. Restrictions
> >
> > Any idea how we can solve this?
>
> What PostgreSQL version are you using? The feature was introduced
> in v11.
> How exactly is the publication defined? Perhaps TRUNCATE is excluded.
>
> Yours,
> Laurenz Albe
>
--
Adrian Klaver
[email protected]
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2024-04-09 14:28 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-04-09 12:07 Re: Regarding: Replication of TRUNCATE commands is not working Arvind Raghuwanshi <[email protected]>
2024-04-09 14:28 ` Adrian Klaver <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox