timescaledb/tsl/test/sql/include/debugsupport.sql
Alexander Kuzmenkov fb3613fe04 Improve evaluation of stable functions such as now() on access node
We have to evaluate the stable functions on the access node and not on
data nodes, where the result might differ, to get consistent results of
the query. Before this change, we used to substitute 'now()' with
textual value of the current timestamp in the query text before sending
it to the data node. This is not sufficient if now() is further wrapped
in a whitelisted (for sending to data nodes) stable function such as
'::timestamp'. Use the standard expression evaluation machinery to also
handle such cases.

Fixes #3598
2021-10-18 18:17:05 +03:00

7 lines
371 B
SQL

-- This file and its contents are licensed under the Timescale License.
-- Please see the included NOTICE for copyright information and
-- LICENSE-TIMESCALE for a copy of the license.
CREATE OR REPLACE FUNCTION test.tsl_override_current_timestamptz(new_value TIMESTAMPTZ)
RETURNS VOID AS :TSL_MODULE_PATHNAME, 'ts_test_override_current_timestamptz' LANGUAGE C VOLATILE;