pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feedFrom: BbIKTOP (@BbIKTOP) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] issue #3482: When using java.sql.Timestamp for update, an exception thrown
Date: Sun, 19 Jan 2025 22:17:48 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
> using (select ? as id, ? as ts, ? as amount) src everything in the paren is a stand alone subquery and there is no context, so the 'YYYY-MM-DD HH:MM:SS.SSSSS' of the timestamp is assumed "unknown" and cast to "text"
>
Just to explain my point a bit further. Suppose, there's grammar that defaults undeclared variables to text. In this case, your example is correct, like
```
somevar=3.3;
```
might produce an error, although it is easy to set the type to the type used in the first assignment.
But in my case, after parsing, the type is actually known as variable is used in the assignment. So, variable type definitely should be equal to the column's type it is assigned to. The only potential error I see here is some kind of "type mismatch" if column types differ in inserts/updates. As parser parses whole statement before execution, it is definitely possible to check and assign correct type after parsing. Looks like it just does not do that.
view thread (48+ messages) latest in thread
reply
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 using the --to and --cc options:
reply via email
To: github://pgjdbc/pgjdbc
Cc: [email protected], [email protected]
Subject: Re: [pgjdbc/pgjdbc] issue #3482: When using java.sql.Timestamp for update, an exception thrown
In-Reply-To: <<[email protected]>>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox