Re: infinite loop in an update statement

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Fabrice Chapuis <fabrice636861(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: infinite loop in an update statement
Date: 2024-09-10 14:57:40
Message-ID: 0bd0a3be-b181-4ac7-bb9e-6ee5aec35d6c@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 9/10/24 07:47, Fabrice Chapuis wrote:
Reply to list also
Ccing list

> no trigger on theses tables

>
> On Mon, Sep 9, 2024 at 5:00 PM Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com
> <mailto:adrian(dot)klaver(at)aklaver(dot)com>> wrote:
>
> On 9/9/24 07:55, Fabrice Chapuis wrote:
> > Hi,
> >
> > table a and b are empty, this query does not return. It seems we
> enter
> > in infinite loop.
> > why this update does not return instantly?
> >
> > UPDATE table_a a
> >   SET col1 = (SELECT MIN(b.col1)
> >                      FROM table_b b
> >                      WHERE b.col2 = a.col2)
>
> Do you have an UPDATE trigger on table_a?
>
> >
> > Regards,
> >
> > Fabrice
> >
> >
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com <mailto:adrian(dot)klaver(at)aklaver(dot)com>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2024-09-10 15:07:04 Removing duplicate rows in table
Previous Message Pecsök Ján 2024-09-10 13:11:16 Error:could not extend file " with FileFallocate(): No space left on device