You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
User-defined function called "time_bucket" triggers internal errorย #10189
-- Query against a hypertable that calls a user-defined function named
-- time_bucket raises SQLSTATE XX000 at planning time.
CREATE TABLE beverage_pours (served_at bigint NOT NULL, drink_name text);
SELECT create_hypertable('beverage_pours', 'served_at', chunk_time_interval => 1000);
INSERT INTO beverage_pours VALUES (1, 'mojito'), (100, 'negroni'), (500, 'spritz');
CREATE FUNCTION time_bucket(int, text) RETURNS text
AS $$ BEGIN RETURN left($2, $1); END $$ LANGUAGE plpgsql;
-- baseline: an equivalent qual not calling time_bucket returns three rows
SELECT * FROM beverage_pours WHERE left(drink_name, 1) < 'z';
-- same qual through the user-defined time_bucket function
SELECT * FROM beverage_pours WHERE time_bucket(1, drink_name) < 'z';
-- ERROR: XX000: unsupported datatype in const_to_integral_timeval: text
Activity
Fix UDF named time_bucket causing XX000
Fix UDF named time_bucket causing XX000
Fix UDF named time_bucket causing XX000
Fix UDF named time_bucket causing XX000
Fix UDF named time_bucket causing XX000
Fix UDF named time_bucket causing XX000
Fix UDF named time_bucket causing XX000
Release 2.29.2