Em sáb, 13 de fev de 2021 10:01, Mark Rotteveel <m...@lawinegevaar.nl> escreveu:
> On 13-02-2021 13:52, Dimitry Sibiryakov wrote: > > 13.02.2021 13:41, Mark Rotteveel wrote: > >> However if we're going to change this, we need to ensure that data > >> type binding to WITHOUT TIME ZONE types will still work correctly > >> (AFAIK, it currently uses the same code path as a cast), that is: > >> render in the session time zone. > > > > Unfortunately it has another problem: SET BIND affects only data type > > reported to client by info calls. The rest is up to general data type > > coercion mechanic which cannot (should not) be different from CAST one. > > Then CAST should remain as it is now, and we should introduce a > construct to 'truncate' a WITH TIME ZONE into a WITHOUT TIME ZONE > without changing its wall clock time. > > Suggestions: > > - TRUNCATE_TIMESTAMP(tz_value) (as I suggested earlier) > - TRUNC(tz_value) (as you suggested) > - tz_value WITHOUT TIME ZONE (as an analogue of `AT ...`) > I think we should not add a function for a not common operation that can be easily done in other ways. In addition to the substring way, one could do it with a simple custom function. As documented, at function start one could issue a set time zone 'gmt', convert the timestamp/tz value to timestamp and restore the time zone (to the one of the function caller) with set time zone local. Adriano
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel