Re: BUG #14268: NULL parameter conversion
От | Jordan Gigov |
---|---|
Тема | Re: BUG #14268: NULL parameter conversion |
Дата | |
Msg-id | CA+nBocCXCvb3G0y7tsjE+GJ2E0OJfWXK6kTqQV8N02t6J=RKjQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: BUG #14268: NULL parameter conversion ("David G. Johnston" <david.g.johnston@gmail.com>) |
Ответы |
Re: BUG #14268: NULL parameter conversion
|
Список | pgsql-bugs |
So, you're saying SQL is too sane a language for you and you'd rather have 30+ non-convertible types of null? 2016-07-28 16:56 GMT+03:00 David G. Johnston <david.g.johnston@gmail.com>: > 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= at > 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 s= qlType); 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. B= ut > I can say this isn't a bug. PostgreSQL is operating as expected given ho= w > it handles NULL. > > David J. > > >
В списке pgsql-bugs по дате отправления: