diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index d60a38a0a0a..fd9c4daea67 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -13158,14 +13158,16 @@ flatten_reloptions(Oid relid) Datum pg_get_dynamic_table_schedule(PG_FUNCTION_ARGS) { - Oid relid = PG_GETARG_OID(0); - Relation pg_task; - StringInfoData buf; - char *username; + Oid relid = PG_GETARG_OID(0); + Relation pg_task; + StringInfoData buf; + char *username; SysScanDesc scanDescriptor = NULL; - ScanKeyData scanKey[2]; + ScanKeyData scanKey[2]; HeapTuple heapTuple = NULL; Form_pg_task task = NULL; + bool isnull; + Datum datum; if (!get_rel_relisdynamic(relid)) { @@ -13209,7 +13211,10 @@ pg_get_dynamic_table_schedule(PG_FUNCTION_ARGS) task = (Form_pg_task) GETSTRUCT(heapTuple); resetStringInfo(&buf); - appendStringInfo(&buf, "%s", text_to_cstring(&task->schedule)); + datum = heap_getattr(heapTuple, Anum_pg_task_schedule, + RelationGetDescr(pg_task), &isnull); + if (!isnull) + appendStringInfo(&buf, "%s", TextDatumGetCString(datum)); systable_endscan(scanDescriptor); table_close(pg_task, AccessShareLock); diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 3de2e549f4c..851e58debc3 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -60,6 +60,6 @@ */ /* 3yyymmddN */ -#define CATALOG_VERSION_NO 302512051 +#define CATALOG_VERSION_NO 302606111 #endif diff --git a/src/include/catalog/pg_task.h b/src/include/catalog/pg_task.h index 387d5945748..e58128b7b65 100644 --- a/src/include/catalog/pg_task.h +++ b/src/include/catalog/pg_task.h @@ -39,14 +39,16 @@ CATALOG(pg_task,9637,TaskRelationId) BKI_SHARED_RELATION { Oid jobid; + int32 nodeport; + bool active BKI_DEFAULT(t); +#ifdef CATALOG_VARLEN /* variable-length fields start here */ text schedule; text command; text nodename; - int32 nodeport; text database; text username; - bool active BKI_DEFAULT(t); - text jobname; + text jobname BKI_FORCE_NULL; +#endif } FormData_pg_task; typedef FormData_pg_task *Form_pg_task; diff --git a/src/include/catalog/pg_task_run_history.h b/src/include/catalog/pg_task_run_history.h index fdb636c7f00..74bd5883a46 100644 --- a/src/include/catalog/pg_task_run_history.h +++ b/src/include/catalog/pg_task_run_history.h @@ -41,16 +41,18 @@ */ CATALOG(pg_task_run_history,9993,TaskRunHistoryRelationId) BKI_SHARED_RELATION { - Oid runid; - Oid jobid; + Oid runid; + Oid jobid; int32 job_pid BKI_DEFAULT(0); + timestamptz start_time BKI_FORCE_NULL; + timestamptz end_time BKI_FORCE_NULL; +#ifdef CATALOG_VARLEN /* variable-length fields start here */ text database; text username; text command; text status; - text return_message; - timestamptz start_time; - timestamptz end_time; + text return_message BKI_FORCE_NULL; +#endif } FormData_pg_task_run_history; typedef FormData_pg_task_run_history *Form_pg_task_run_history;