Skip to content

Commit

Permalink
Merge pull request #68 from PanDAWMS/postgres16
Browse files Browse the repository at this point in the history
Support for Postgres16
  • Loading branch information
EdwardKaravakis authored May 22, 2024
2 parents 27463a4 + c788944 commit 10b30a1
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 39 deletions.
7 changes: 4 additions & 3 deletions schema/postgres/sqls/pg_PANDA_TABLE.sql
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ CREATE TABLE harvester_dialogs (
diagid bigint NOT NULL,
modulename varchar(100),
identifier varchar(100),
creationtime timestamp,
creationtime timestamp NOT NULL,
-- creationtime timestamp NOT NULL DEFAULT to_date('01-JAN-1970 00:00:00','DD-MON-YYYY HH24:MI:SS'),
messagelevel varchar(10),
diagmessage varchar(500)
) PARTITION BY RANGE (creationtime) ;
Expand Down Expand Up @@ -378,7 +379,7 @@ ALTER TABLE harvester_instances ADD PRIMARY KEY (harvester_id);

CREATE TABLE harvester_metrics (
harvester_id varchar(50) NOT NULL,
creation_time timestamp DEFAULT LOCALTIMESTAMP,
creation_time timestamp NOT NULL DEFAULT LOCALTIMESTAMP,
harvester_host varchar(100),
metrics varchar(4000)
) PARTITION BY RANGE (creation_time) ;
Expand Down Expand Up @@ -781,7 +782,7 @@ CREATE TABLE jedi_job_retry_history (
jeditaskid bigint NOT NULL,
oldpandaid bigint NOT NULL,
newpandaid bigint NOT NULL,
ins_utc_tstamp timestamp DEFAULT ((CURRENT_TIMESTAMP(0) AT TIME ZONE 'UTC')),
ins_utc_tstamp timestamp NOT NULL DEFAULT ((CURRENT_TIMESTAMP(0) AT TIME ZONE 'UTC')),
relationtype varchar(16),
originpandaid bigint
) PARTITION BY RANGE (ins_utc_tstamp) ;
Expand Down
72 changes: 36 additions & 36 deletions schema/postgres/sqls/pg_PARTITION.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
SELECT partman.create_parent(
p_parent_table => 'doma_panda.datasets',
p_control => 'modificationdate',
p_type => 'native',
p_interval=> 'monthly',
p_type => 'range',
p_interval=> '1 month',
p_premake => 3
);
UPDATE partman.part_config
Expand All @@ -17,8 +17,8 @@ WHERE parent_table = 'doma_panda.datasets'
SELECT partman.create_parent(
p_parent_table => 'doma_panda.jobs_statuslog',
p_control => 'modificationtime',
p_type => 'native',
p_interval=> 'daily',
p_type => 'range',
p_interval=> '1 day',
p_premake => 3
);
UPDATE partman.part_config
Expand All @@ -31,8 +31,8 @@ WHERE parent_table = 'doma_panda.jobs_statuslog'
SELECT partman.create_parent(
p_parent_table => 'doma_panda.tasks_statuslog',
p_control => 'modificationtime',
p_type => 'native',
p_interval=> 'daily',
p_type => 'range',
p_interval=> '1 day',
p_premake => 3
);
UPDATE partman.part_config
Expand All @@ -45,8 +45,8 @@ WHERE parent_table = 'doma_panda.tasks_statuslog'
SELECT partman.create_parent(
p_parent_table => 'doma_panda.harvester_dialogs',
p_control => 'creationtime',
p_type => 'native',
p_interval=> 'daily',
p_type => 'range',
p_interval=> '1 day',
p_premake => 3
);
UPDATE partman.part_config
Expand All @@ -59,8 +59,8 @@ WHERE parent_table = 'doma_panda.harvester_dialogs'
SELECT partman.create_parent(
p_parent_table => 'doma_panda.harvester_metrics',
p_control => 'creation_time',
p_type => 'native',
p_interval=> 'daily',
p_type => 'range',
p_interval=> '1 day',
p_premake => 3
);
UPDATE partman.part_config
Expand All @@ -73,8 +73,8 @@ WHERE parent_table = 'doma_panda.harvester_metrics'
SELECT partman.create_parent(
p_parent_table => 'doma_panda.harvester_workers',
p_control => 'lastupdate',
p_type => 'native',
p_interval=> 'daily',
p_type => 'range',
p_interval=> '1 day',
p_premake => 3
);
UPDATE partman.part_config
Expand All @@ -87,8 +87,8 @@ WHERE parent_table = 'doma_panda.harvester_workers'
SELECT partman.create_parent(
p_parent_table => 'doma_panda.jedi_job_retry_history',
p_control => 'ins_utc_tstamp',
p_type => 'native',
p_interval=> 'daily',
p_type => 'range',
p_interval=> '1 day',
p_premake => 3
);
UPDATE partman.part_config
Expand All @@ -101,8 +101,8 @@ WHERE parent_table = 'doma_panda.jedi_job_retry_history'
SELECT partman.create_parent(
p_parent_table => 'doma_panda.task_attempts',
p_control => 'starttime',
p_type => 'native',
p_interval=> 'daily',
p_type => 'range',
p_interval=> '1 day',
p_premake => 3
);
UPDATE partman.part_config
Expand All @@ -115,8 +115,8 @@ WHERE parent_table = 'doma_panda.task_attempts'
SELECT partman.create_parent(
p_parent_table => 'doma_panda.pandalog',
p_control => 'bintime',
p_type => 'native',
p_interval=> 'daily',
p_type => 'range',
p_interval=> '1 day',
p_premake => 3
);
UPDATE partman.part_config
Expand All @@ -131,8 +131,8 @@ WHERE parent_table = 'doma_panda.pandalog'
SELECT partman.create_parent(
p_parent_table => 'doma_panda.jobsarchived4',
p_control => 'modificationtime',
p_type => 'native',
p_interval=> 'monthly',
p_type => 'range',
p_interval=> '1 month',
p_premake => 3
);
UPDATE partman.part_config
Expand All @@ -145,8 +145,8 @@ WHERE parent_table = 'doma_panda.jobsarchived4'
SELECT partman.create_parent(
p_parent_table => 'doma_panda.filestable4',
p_control => 'modificationtime',
p_type => 'native',
p_interval=> 'daily',
p_type => 'range',
p_interval=> '1 day',
p_premake => 3
);
UPDATE partman.part_config
Expand All @@ -159,8 +159,8 @@ WHERE parent_table = 'doma_panda.filestable4'
SELECT partman.create_parent(
p_parent_table => 'doma_panda.metatable',
p_control => 'modificationtime',
p_type => 'native',
p_interval=> 'daily',
p_type => 'range',
p_interval=> '1 day',
p_premake => 3
);
UPDATE partman.part_config
Expand All @@ -173,8 +173,8 @@ WHERE parent_table = 'doma_panda.metatable'
SELECT partman.create_parent(
p_parent_table => 'doma_panda.jobparamstable',
p_control => 'modificationtime',
p_type => 'native',
p_interval=> 'daily',
p_type => 'range',
p_interval=> '1 day',
p_premake => 3
);
UPDATE partman.part_config
Expand All @@ -189,63 +189,63 @@ WHERE parent_table = 'doma_panda.jobparamstable'
SELECT partman.create_parent(
p_parent_table => 'doma_panda.jedi_tasks',
p_control => 'jeditaskid',
p_type => 'native',
p_type => 'range',
p_interval=> '1000000',
p_premake => 3
);

SELECT partman.create_parent(
p_parent_table => 'doma_panda.jedi_datasets',
p_control => 'jeditaskid',
p_type => 'native',
p_type => 'range',
p_interval=> '1000000',
p_premake => 3
);

SELECT partman.create_parent(
p_parent_table => 'doma_panda.jedi_dataset_contents',
p_control => 'jeditaskid',
p_type => 'native',
p_type => 'range',
p_interval=> '1000000',
p_premake => 3
);

SELECT partman.create_parent(
p_parent_table => 'doma_panda.jedi_events',
p_control => 'jeditaskid',
p_type => 'native',
p_type => 'range',
p_interval=> '1000000',
p_premake => 3
);

SELECT partman.create_parent(
p_parent_table => 'doma_panda.jedi_jobparams_template',
p_control => 'jeditaskid',
p_type => 'native',
p_type => 'range',
p_interval=> '1000000',
p_premake => 3
);

SELECT partman.create_parent(
p_parent_table => 'doma_panda.jedi_output_template',
p_control => 'jeditaskid',
p_type => 'native',
p_type => 'range',
p_interval=> '1000000',
p_premake => 3
);

SELECT partman.create_parent(
p_parent_table => 'doma_panda.jedi_taskparams',
p_control => 'jeditaskid',
p_type => 'native',
p_type => 'range',
p_interval=> '1000000',
p_premake => 3
);

SELECT partman.create_parent(
p_parent_table => 'doma_panda.harvester_rel_jobs_workers',
p_control => 'pandaid',
p_type => 'native',
p_type => 'range',
p_interval=> '1000000',
p_premake => 3
);
Expand All @@ -255,8 +255,8 @@ p_premake => 3
SELECT partman.create_parent(
p_parent_table => 'doma_pandameta.usercacheusage',
p_control => 'creationtime',
p_type => 'native',
p_interval=> 'monthly',
p_type => 'range',
p_interval=> '1 month',
p_premake => 3
);
UPDATE partman.part_config
Expand Down

0 comments on commit 10b30a1

Please sign in to comment.