From: Laurenz Albe <laurenz.albe@cybertec.at>
To: 이정호 <curly2620@nate.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Request for Official Technical Clarification on PostgreSQL statement_timeout Error
Date: Mon, 09 Nov 2026 15:42:03 +0100
Message-ID: <946c347b742aa68be103ec00febfc17e79bfac3e.camel@cybertec.at> (raw)
In-Reply-To: <d4691d59718c64ae4f667404eb5e73c4$83c44ef8@m.mail.nate.com>
References: <d4691d59718c64ae4f667404eb5e73c4$83c44ef8@m.mail.nate.com>
On Sun, 2026-10-25 at 22:17 +0900, 이정호 wrote:
> 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?
Yes. Is the error message not clear?
> 2. Are SQL syntax errors, data type errors, and constraint violations reported
> separately from statement_timeout errors?
Yes. The statement is parsed *before* it can be executed.
Syntax errors happen during parsing.
For the statement to time out, it must be running.
The statement cannot start running if there is a syntax error.
> 3. Does this error confirm that the SQL statement was not completed within the
> configured time limit after reaching the PostgreSQL server?
Yes. You will notice that the message was an error message.
An error is a condition that terminates the execution of a statement,
so the statement wasn't completed.
> We understand that identifying the underlying cause of the delay may require additional investigation.
> However, our current request is specifically to confirm the technical meaning of this error message,
> rather than to determine responsibility for the delay.
> We would greatly appreciate a written response based on PostgreSQL’s documented behavior.
The documentation describes that well, see
https://www.postgresql.org/docs/current/runtime-config-client.html#GUC-STATEMENT-TIMEOUT
Abort any statement that takes more than the specified amount of time.
If log_min_error_statement is set to ERROR or lower, the statement that timed
out will also be logged. If this value is specified without units, it is taken
as milliseconds. A value of zero (the default) disables the timeout.
The timeout is measured from the time a command arrives at the server until it
is completed by the server. If multiple SQL statements appear in a single
simple-query message, the timeout is applied to each statement separately.
(PostgreSQL versions before 13 usually treated the timeout as applying to the
whole query string.) In extended query protocol, the timeout starts running when
any query-related message (Parse, Bind, Execute, Describe) arrives, and it is
canceled by completion of an Execute or Sync message.
Yours,
Laurenz Albe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: laurenz.albe@cybertec.at, curly2620@nate.com
Subject: Re: Request for Official Technical Clarification on PostgreSQL statement_timeout Error
In-Reply-To: <946c347b742aa68be103ec00febfc17e79bfac3e.camel@cybertec.at>
References: <d4691d59718c64ae4f667404eb5e73c4$83c44ef8@m.mail.nate.com> <946c347b742aa68be103ec00febfc17e79bfac3e.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox