Re: Avoiding roundoff error in pg_sleep()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Пополитов Владлен <v(dot)popolitov(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Avoiding roundoff error in pg_sleep()
Date: 2025-09-25 19:36:18
Message-ID: 3885231.1758828978@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

=?utf-8?q?=D0=9F=D0=BE=D0=BF=D0=BE=D0=BB=D0=B8=D1=82=D0=BE=D0=B2_=D0=92=D0=BB=D0=B0=D0=B4=D0=BB=D0=B5=D0=BD?= <v(dot)popolitov(at)postgrespro(dot)ru> writes:
> I suspect, that any user, that run something like pg_sleep(1000000000), 
> start transaction, that stops autovacuum and creates other negative effects up to server crash,
> and only this user can stop it by command interrupt (all signals only restart 
> this sleep or kill whole server).

How is this different from any other long-running query?
If you'd bothered to test, you'd have seen that pg_sleep()
is interruptible by query cancel, just like anything else,
so "kill whole server" is not required.

We're not in the business of trying to limit users' resource
consumption. If we wanted to do that, it'd be a very major
undertaking.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-09-25 19:41:25 Re: Avoiding roundoff error in pg_sleep()
Previous Message Robert Haas 2025-09-25 19:19:55 Re: [PATCH] Fix pg_rewind false positives caused by shutdown-only WAL