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
create table image_test(
id varchar(100),
create_time TIMESTAMP DEFAULT (TO_CHAR((NOW() AT TIME ZONE 'Asia/Shanghai'), 'YYYY-MM-DD HH24:MI:SS')::timestamp))
partition by range (create_time);`
create function:
CREATE OR REPLACE FUNCTION create_next_day_partition() RETURNS integer
LANGUAGE PLPGSQL
AS $$
DECLARE
dateStr varchar;
BEGIN
SELECT to_char(DATE 'tomorrow', 'YYYYMMDD') INTO dateStr;
EXECUTE
format('CREATE TABLE image_test_%s PARTITION OF image_test
FOR VALUES FROM (current_date::timestamp + interval ''1 day'') TO (current_date::timestamp + interval ''1 day'' + interval ''1 day'')', dateStr);
RETURN 1;
END;
$$;
PostgreSQL: 12.9
pg_cron:1.5
how to repo
create function:
query the cron job:
it will have two issues:
The text was updated successfully, but these errors were encountered: