7.2 timetz/time/current_time improper behaviour report
От | Radoslaw Stachowiak |
---|---|
Тема | 7.2 timetz/time/current_time improper behaviour report |
Дата | |
Msg-id | 20020328143419.GE19576@blue.alter.pl обсуждение исходный текст |
Список | pgsql-admin |
Examples: mlot=# create temp table dddd ( t1 time,t2 timetz ); CREATE mlot=# insert into dddd values ( now() , now() ); ERROR: column "t1" is of type 'time without time zone' but expression is of type 'timestamp with time zone' You will need to rewrite or cast the expression ok, i know that now() has timezone, so it does not fit to 'time'. mlot=# insert into dddd values (current_time,now()); INSERT 618593 1 mlot=# select * from dddd; t1 | t2 -----------------+-------------------- 15:27:47.065969 | 15:27:47.065969+01 (1 row) ok, BUT: mlot=# select current_time; timetz -------------------- 15:28:08.930204+01 so current_time is timetz type, so why I was able to insert it without cast into t1 field while I couldnt do it with now() ?? more: mlot=# select * from dddd where current_time between t2 AND t2; t1 | t2 ----+---- (0 rows) and: mlot=# select * from dddd where current_time between t1 AND t1; ERROR: Unable to identify an operator '>=' for types 'time with time zone' and 'time without time zone' You will have to retype this query using an explicit cast so current_time is definitely timetz type. BUG?: insert into dddd values (current_time,now()); should not work. please correct me if'm wrong. -- radoslaw.stachowiak.........................................http://alter.pl/
В списке pgsql-admin по дате отправления: