citusdata / citusdata/pg_cron

Setting Values to Condicion Query

Open
#207 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
3.9k
Forks
260
Avg merge
5d 5h
Merged PRs (30d)
1

Description

Hello I have trying to set values to condition in query of cron.schedule:
```sql
SELECT sc.minute_execution_cron,
sc.hour_execution_cron,
sc.day_month_execution_cron,
sc.month_execution_cron,
sc.day_week_execution_cron,
sc.interval_config_mount_delete,
sc.interval_config_type_delete into
x_minute_cron_cl, x_hour_cron_cl, x_day_month_cron_cl,
x_month_cron_cl, x_day_week_cron_cl, x_interval_mount_cron_cl,
x_interval_type_cron_cl
FROM public."setting-cron" as sc
WHERE sc.country = 'XX';

x_time_cron_cl = x_minute_cron_cl || ' ' || x_hour_cron_cl || ' ' ||x_day_month_cron_cl || ' ' || x_month_cron_cl || ' ' || x_day_week_cron_cl;
x_invertal_cron_cl = x_interval_mount_cron_cl || ' ' || x_interval_type_cron_cl;
raise notice 'Value: %', x_invertal_cron_cl;
--perform public."deleteLogs"('2022-08-30 12:45:00', x_invertal_cron_cl, 'CL');
PERFORM cron.schedule('delete-logs-cl',x_time_cron_cl, $$select * from public."deleteLogs"('2022-08-30 12:45:00', x_invertal_cron_cl, 'XX')$$);
```

and the error is:
2022-09-23 03:51:00.013 UTC [1057] ERROR: column "x_invertal_cron_cl" does not exist at character 58
2022-09-23 03:51:00.013 UTC [1057] STATEMENT: select * from public."deleteLogs"('2022-08-30 12:45:00', x_invertal_cron_cl, 'XX')

so,
is it possible?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the cron.schedule entry point and the SQL command passed to it, then compare that behavior with the public.deleteLogs call shown in the issue. Reproduce the reported column-not-found error and establish whether the requested variable substitution is supported; document the result or define the required change.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, sql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.