Message-ID: From: "labkey-martyp (@labkey-martyp)" To: "pgjdbc/pgjdbc" Date: Mon, 27 Apr 2026 21:17:40 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #4039: timestampdiff parameter swapping In-Reply-To: References: List-Id: X-GitHub-Author-Login: labkey-martyp X-GitHub-Comment-Id: 4330508226 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 4039 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/4039#issuecomment-4330508226 Content-Type: text/plain; charset=utf-8 Thanks for looking into it. I looked a bit more in the code and docs and it looks like the driver has an escape function [implementation](https://github.com/pgjdbc/pgjdbc/blob/b04fc46af6c207bc7ce9e788fea8c43d18b73d0f/pgjdbc/src/main/java/org/postgresql/jdbc/EscapedFunctions2.java#L571) that will work when string literals are in the parameters, but for any escape scalar function if the output reorders the parameters then prepared statements are not supported (per the second paragraph [here](https://jdbc.postgresql.org/documentation/escapes/#escaped-scalar-functions)).