Subject: Errors of a Postgresql replication with PowerBi

From: Erik Serrano <[email-masked]>
Date: Mon, 10 Feb 2025 18:10:30 -0300

Dear Postgresql community,

Along with greetings, I would like to consult a problem related to a
streaming replication slave server in Postgresql version 15 that is being
used as a server for PowerBi queries.

I have been receiving some comments about errors in PBi queries that fail
because they have problems with replication.

The configuration of that server is basic (it has some additional
parameters) but I think that some additional configuration can be done that
allows me to improve the performance of the queries.

I attach the errors that normally appear to me and my configuration file.

I hope you can help me or guide me in a possible solution
Thank you very much in advance

Regards

*Erik R. Serrano Saavedra*
*      Data Base Administrator*

---

From: Mendbayar Alzakhgui <[email-masked]>
Date: Tue, 11 Feb 2025 07:41:35 +0000

Hi Erik,

I’m not an expert on Postgres, but I found out that configuration tuning needed on the Postgresql server, like shared_buffers, work mem etc.
And from the logs you’ve provided I’ve seen it like the replica server has failed somehow, check connection and need to check if it’s alive from the primary server like

select * from pg_stat_replication_slots;
select * from pg_replication_slots;

And better to check if the replica has error log on it.

Sincerely,

Mendbayar A.

From: Erik Serrano <[email-masked]>
Sent: Tuesday, February 11, 2025 5:11 AM
To: Pgsql-admin <[email-masked]>; [email-masked]
Subject: Errors of a Postgresql replication with PowerBi

You don't often get email from [email-masked]<mailto:[email-masked]>. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
ТУХАЙН ИЛГЭЭГЧ НЬ МАНАЙ ХАРИЛЦАГЧИЙН ИМЭЙЛ БИШ БАЙНА!!
Сэжигтэй тохиолдолд "[email-masked]<mailto:[email-masked]>" рүү заавал мэдэгдэнэ үү.

Along with greetings, I would like to consult a problem related to a streaming replication slave server in Postgresql version 15 that is being used as a server for PowerBi queries.

I have been receiving some comments about errors in PBi queries that fail because they have problems with replication.

The configuration of that server is basic (it has some additional parameters) but I think that some additional configuration can be done that allows me to improve the performance of the queries.

Regards

Erik R. Serrano Saavedra
      Data Base Administrator

---

From: Erik Serrano <[email-masked]>
Date: Tue, 11 Feb 2025 09:45:08 -0300

Thank you for your help!

El mar, 11 feb 2025 a las 4:41, Mendbayar Alzakhgui (<
[email-masked]>) escribió:

> Hi Erik,
>
> I’m not an expert on Postgres, but I found out that configuration tuning
> needed on the Postgresql server, like shared_buffers, work mem etc.
>
> And from the logs you’ve provided I’ve seen it like the replica server has
> failed somehow, check connection and need to check if it’s alive from the
> primary server like
>
>
>
> * Mendbayar A.*
> *From:* Erik Serrano <[email-masked]>
> *Sent:* Tuesday, February 11, 2025 5:11 AM
> *To:* Pgsql-admin <[email-masked]>;
> [email-masked]
> *Subject:* Errors of a Postgresql replication with PowerBi
>
>
>
> You don't often get email from [email-masked]. Learn why this is
> important <https://aka.ms/LearnAboutSenderIdentification>
>
> *ТУХАЙН ИЛГЭЭГЧ НЬ МАНАЙ ХАРИЛЦАГЧИЙН ИМЭЙЛ БИШ БАЙНА!!*
> *Сэжигтэй тохиолдолд "[email-masked] <[email-masked]>" рүү заавал
> мэдэгдэнэ үү.*
>
>
>

---

From: Ron Johnson <[email-masked]>
Date: Tue, 11 Feb 2025 08:48:04 -0500

> Thank you very much in advance
In the _004.jpg file, I see integer underflow.  Or integer overflow that
wraps around to negative 2.1 billion.

Maybe that column needs to be a BIGINT, and the PBI code needs to use int8?

-- 
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

---

From: Erik Serrano <[email-masked]>
Date: Tue, 11 Feb 2025 11:02:51 -0300

Dear Ron,

Excellent assessment Ron, Thank you very much ... I will share it with the
architect.

Thank you very much

---

From: Laurenz Albe <[email-masked]>
Date: Tue, 11 Feb 2025 15:08:17 +0100

On Tue, 2025-02-11 at 08:48 -0500, Ron Johnson wrote:
> > Along with greetings, I would like to consult a problem related to a streaming replication
> > slave server in Postgresql version 15 that is being used as a server for PowerBi queries.
> 
> In the _004.jpg file, I see integer underflow.  Or integer overflow that wraps around to negative 2.1 billion.
>  

I see the following error in one image:

  canceling statement due to conflict with recovery

If you want to avoid that error and don't mind if replay of changes to
the standby server gets delayed, set "max_standby_streaming_delay" to -1.

Yours,
Laurenz Albe

-- 

*E-Mail Disclaimer*
Der Inhalt dieser E-Mail ist ausschliesslich fuer den 
bezeichneten Adressaten bestimmt. Wenn Sie nicht der vorgesehene Adressat 
dieser E-Mail oder dessen Vertreter sein sollten, so beachten Sie bitte, 
dass jede Form der Kenntnisnahme, Veroeffentlichung, Vervielfaeltigung oder 
Weitergabe des Inhalts dieser E-Mail unzulaessig ist. Wir bitten Sie, sich 
in diesem Fall mit dem Absender der E-Mail in Verbindung zu setzen.

*CONFIDENTIALITY NOTICE & DISCLAIMER
*This message and any attachment are 
confidential and may be privileged or otherwise protected from disclosure 
and solely for the use of the person(s) or entity to whom it is intended. 
If you have received this message in error and are not the intended 
recipient, please notify the sender immediately and delete this message and 
any attachment from your system. If you are not the intended recipient, be 
advised that any use of this message is prohibited and may be unlawful, and 
you must not copy this message or attachment or disclose the contents to 
any other person.

---

From: Erik Serrano <[email-masked]>
Date: Tue, 11 Feb 2025 11:45:28 -0300

Excellent Laurens, Currently I have this parameter at 180s, but I think it
would be better at -1 to make it more dynamic,
I will apply it

Thank you very much

El mar, 11 feb 2025 a las 11:08, Laurenz Albe (<[email-masked]>)
escribió:

> streaming replication