Subject: Re: Is there any limit on the number of rows to import using copy command

From: Laurenz Albe <[email-masked]>
Date: Wed, 23 Jul 2025 16:10:44 +0200

On Wed, 2025-07-23 at 11:55 +0000, [email-masked] wrote:
> 1.  I tried running Copy From command from PGAdmin.  
> 2.  I ran pg_stat_activity also in another tab [ PGAdmin ].
> 
> What I observed,
> 1.  In about 2 min, in the Dashboard of PGAdmin, the colour changed to Orange for that particular pid.
> 2.  After few seconds, the colour again changed to Red.   
> 3.  The stat column in both Dashboard and pg_stat_activity.state shows 'active'.
> 4.  No messages relevant to this pid in postgres' log files
> 5.  CPU usage is normal, hovering around 36% overall, 15-18% for postgresql server, from the beginning and even after 3 min.
> 6.  We didn't run any other application in that machine.  
> 7.  Unique Index is there in table2 which will return only one row for that Select Count(*) query.
> 8.  No record is there in the target table when transfer started.  This transfer is the first batch for that particular table.
> 9.  Once color turned into Red, I could cancel the query execuion in PGAdmin, which immediately stops the execution.
> 10. I could not see any locks or blocking pids.

As far as I know, red in pgAdmin (I don't use it) *is* the indication for a wait event.
So look again what the columns "wait_event_type" and "wait_event" in "pg_stat_activity" show.

Yours,
Laurenz Albe

---

From: "[email-masked]" <[email-masked]>
Date: Thu, 24 Jul 2025 23:14:09 +0000 (UTC)

Those two columns have null values when the color turns into Red.
And the status column shows 'active' only.   All those three column values are same (null, null, active) even after 2 hours!
It works when I split the trigger function into three, one each for insert, delete and update call from three different triggers.  I've replied that separately.
Happiness Always
BKR Sivaprakash

    On Wednesday 23 July, 2025 at 07:41:06 pm IST, Laurenz Albe <[email-masked]> wrote:  

Yours,
Laurenz Albe