Re: Literal vs parameterized 'timestamp with time zone' value
В списке pgsql-jdbc по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Literal vs parameterized 'timestamp with time zone' value |
| Дата | |
| Msg-id | 7656.1182273574@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Literal vs parameterized 'timestamp with time zone' value (Kris Jurka <books@ejurka.com>) |
| Список | pgsql-jdbc |
Kris Jurka <books@ejurka.com> writes:
> In the second example a string comparison is being done instead of a
> timestamp comparison. Consider this psql example:
> jurka=# select now() < 'a'::text;
> ?column?
> ----------
> t
> (1 row)
BTW, as of 8.3 this particular foot-gun will go away:
regression=# select now() < 'a'::text;
ERROR: operator does not exist: timestamp with time zone < text
LINE 1: select now() < 'a'::text;
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
You'll still be able to force a textual comparison if you really want
one:
regression=# select now()::text < 'a'::text;
?column?
----------
t
(1 row)
but it won't happen silently.
regards, tom lane
В списке pgsql-jdbc по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера