Re: BUG #14268: NULL parameter conversion
От | David G. Johnston |
---|---|
Тема | Re: BUG #14268: NULL parameter conversion |
Дата | |
Msg-id | CAKFQuwYAQw9u1=-Z9AWjcU28hpF02=tWdS0nU=gr6HdiBY-YFQ@mail.gmail.com обсуждение исходный текст |
Ответ на | BUG #14268: NULL parameter conversion (coladict@gmail.com) |
Ответы |
Re: BUG #14268: NULL parameter conversion
|
Список | pgsql-bugs |
On Thu, Jul 28, 2016 at 9:30 AM, <coladict@gmail.com> wrote: > The following bug has been logged on the website: > > Bug reference: 14268 > Logged by: Jordan Gigov > Email address: coladict@gmail.com > PostgreSQL version: 9.3.13 > Operating system: Ubuntu 14.04 > Description: =E2=80=8B[...]=E2=80=8B > > When the value is NULL, the type > shouldn't matter. > =E2=80=8BAccording to what authority? =E2=80=8B[...] > INSERT INTO my_array_table(somedata) VALUES (NULL::bytea); > =E2=80=8BIf you are saying the above should work I'd say that is arguable a= t best.=E2=80=8B All values, even NULL, are typed in PostgreSQL. > I recognize that the JDBC driver explicitly sends the parameter type in a > prepared statement, but I think it should be ignored when the value is > NULL. > =E2=80=8BAs your first example shows if the NULL remains unknown it will be auto-cast according to the context in which it is used. Its not PostgreSQL's place to discard type information. =E2=80=8BThe JDBC API defines "setNull(int parameterIndex, int=E2=80=8B sql= Type); which makes me inclined to say your complaint should be directed at JPA and not either PostgreSQL itself or JDBC. Now, as I am lacking knowledge about the specific problem, JPA, and how other databases function, I am unable to meaningfully comment further. But I can say this isn't a bug. PostgreSQL is operating as expected given how it handles NULL. David J.
В списке pgsql-bugs по дате отправления: