Re: Request for Official Technical Clarification on PostgreSQL statement_timeout Error

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: 이정호 <curly2620(at)nate(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Request for Official Technical Clarification on PostgreSQL statement_timeout Error
Date: 2026-11-09 14:41:06
Message-ID: CAKFQuwZTEWVoWj2jpBjX=zZU5xgtZEkV+PR07Z8R7kV6cLaahg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Nov 9, 2026 at 5:47 AM 이정호 <curly2620(at)nate(dot)com> wrote:

> Hello,
>
> I am an automation system engineer in South Korea.
>
> Our application executes SQL INSERT statements on a PostgreSQL database
> using VBScript.
>
> During execution, we encountered the following error:
>
> canceling statement due to statement timeout
>
> Error while executing the query
>
> We would like to obtain a technical clarification regarding the exact
> meaning of this error.
>
> According to the PostgreSQL documentation, statement_timeout is measured
> from the time a command arrives at the server until it is completed.
>
> Could you please confirm the following?
>
> 1. Does this error indicate that PostgreSQL received the SQL command
> and canceled it because the configured statement_timeout limit was exceeded?
>
> Trivial to find out what error message that error triggers:

postgres=# set statement_timeout = '1s';
SET
postgres=# select pg_sleep(3000);
ERROR: canceling statement due to statement timeout
postgres=#

You second message is likely from your client/application, not PostgreSQL

> 1. Are SQL syntax errors, data type errors, and constraint violations
> reported separately from statement_timeout errors?
>
> Yes. The first one encountered is reported. As is typical with nearly
all software.

>
> 1. Does this error confirm that the SQL statement was not completed
> within the configured time limit after reaching the PostgreSQL server?
>
> "The timeout is measured from the time a command arrives at the server" =
"after reaching the PostgreSQL server"
https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-STATEMENT-TIMEOUT

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2026-11-09 14:42:03 Re: Request for Official Technical Clarification on PostgreSQL statement_timeout Error
Previous Message BUBACZ Martin 2026-11-09 11:45:11 AW: [EXTERNAL] Re: Update pg_stat_monitor failed