Re: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres

2023-04-09 Thread Adrian Klaver
On 4/9/23 19:16, Rob Sargent wrote: On 4/9/23 19:55, Louis Tian wrote: Hi Alban, "I am not expecting an error here", by "here" I means when doing a TRUE UPSERT (an upsert current does not exist in Postgres). I am NOT referring to an "Insert on conflict do update" (which despite its intention

Re: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres

2023-04-09 Thread Rob Sargent
On 4/9/23 19:55, Louis Tian wrote: Hi Alban, "I am not expecting an error here", by "here" I means when doing a TRUE UPSERT (an upsert current does not exist in Postgres). I am NOT referring to an "Insert on conflict do update" (which despite its intention and wide acceptance is not fully equi

RE: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres

2023-04-09 Thread Louis Tian
Hi Alban, "I am not expecting an error here", by "here" I means when doing a TRUE UPSERT (an upsert current does not exist in Postgres). I am NOT referring to an "Insert on conflict do update" (which despite its intention and wide acceptance is not fully equivalent to a true upsert). I underst

RE: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres

2023-04-09 Thread Louis Tian
Hi Francisco, I think we need to make a distinction between an "operation" and a "statement". The concept of idempotency applies to an "operation" not an entire statement. Like how HTTP "PUT" method is defined as "idempotent", you don't say actual HTTP PUT request is idempotent. With the "curr

Re: Postgresql Upgrade from 10 to 14

2023-04-09 Thread Tom Lane
thayanban thay writes: > Issue: We upgraded postgresql from 10 to 14 version, post to the upgrade , > queries are running very slower than normal expected time. As well as the > queries are not getting completed . We did vacuum analyze, index recreation > and analyze statements etc but no luck sti

Re: Postgresql Upgrade from 10 to 14

2023-04-09 Thread Adrian Klaver
On 4/8/23 18:03, thayanban thay wrote:   Hi Team, I need some help or suggestions for the below issue. Please provide answers what to do now. We re in critical position to handle the issue. Issue: We upgraded postgresql from 10 to 14 version, post to the upgrade , queries are running very s

Re: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres

2023-04-09 Thread Louis Tian
Hi Adrian,  > No it is not as Israel Brewster pointed out. I think we need make a distinction between an operation and a statement here The examples Israel presented and yours are both non-idempotent statements because the different value being upserted each time the statement is executed.  Not b

Re: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres

2023-04-09 Thread Louis Tian
From: Israel Brewster Sent: Sunday, April 9, 2023 3:09 AM To: Louis Tian Cc: Peter Geoghegan ; pgsql-general@lists.postgresql.org Subject: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres Thanks Israel. Your example really helped me to understand where we d

Postgresql Upgrade from 10 to 14

2023-04-09 Thread thayanban thay
Hi Team, I need some help or suggestions for the below issue. Please provide answers what to do now. We re in critical position to handle the issue. Issue: We upgraded postgresql from 10 to 14 version, post to the upgrade , queries are running very slower than normal expected time. As well as t

Re: Replicate data from one standby server to another standby

2023-04-09 Thread Inzamam Shafiq
Yes, you can replicate data from one slave to another. Sent from Outlook for Android From: Atul Kumar Sent: Sunday, April 9, 2023 3:14:06 PM To: pgsql-general Subject: Replicate data from one standby server to another standby Hi, I have

Replicate data from one standby server to another standby

2023-04-09 Thread Atul Kumar
Hi, I have Configured "sync" streaming replication to replicate the data from one primary node to one slave node. Now I want one to add one more node as slave that will replicate the data from previously created slave replica (not from primary replica as we do traditionally). So please let me k

Re: [EXTERNAL]: Re: UPSERT in Postgres

2023-04-09 Thread Francisco Olarte
(not the OP on idempotency) On Sat, 8 Apr 2023 at 18:33, Louis Tian wrote: > > In general UPSERT (or any definition of it that I can think of) does > > not imply idempotency. > "Idempotence is the property of certain operations in mathematics and > computer science whereby they can be applied mu

Re: [EXTERNAL]: Re: UPSERT in Postgres

2023-04-09 Thread Alban Hertroys
> On 7 Apr 2023, at 2:49, Louis Tian wrote: (…) > I am not expecting an error here. The problem is with no conflict it always > go down the insert path first and results in a not null constraint error. > While I am expecting the insert is never executed in the first place when > that row al