What's the life span of a PostgreSQL server-side prepared statement

前端 未结 2 1314
耶瑟儿~
耶瑟儿~ 2020-12-29 13:16

According to the PostgreSQL documentation, a prepared statement is bound to a database session/connection:

PREPARE creates a prepared statement. A pre

2条回答
  •  误落风尘
    2020-12-29 13:36

    I think both are true, but in doubt the PostgreSQL documentation usually more true than me. However, here I think the PostgreSQL doc might be inaccurate.

    It should probably read like this:

    Prepared statements only last until it is DEALLOCATEed and no longer than the duration of the current database session.

    Without checking I would strongly believe that the JDBC driver deallocates the server-side prepared statement when the JDBC PreparedStatement is closed.

提交回复
热议问题