Skip to content

nnampally/pg_partition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 

Repository files navigation

pg_partition

Here steps to create partition using these functions.Create these two fuctions in same schema.

  1. Create function #sub_partition.sql
  2. create function #create_partition_tables.sql
  3. call function select create_partiton ( 'public.test10','name','hash','10',4,null,true,'dt','list','monthly');
      p_parent_table text:='public.actvty_details'; -- parent table
      p_part_col text:='actvty_dt' ; --partition COLUMN
      p_type text:='range';  -- partition type range,list, hash
      p_interval text:='monthly' ; --time/date:  daily, monthly,yearly , id : 10,1000 any range, list = 'west,north,south,east', maduler = 5,10,20 etc
      p_fk_cols text:=null; -- constraint COLUMN, null or 'id'
      p_premake int:=4;-- no of partition tables to be created
/****************************************/ 
/******* sub-partition ******************/   
/****************************************/   
      p_sub_partition BOOLEAN:= true;
      p_sub_part_col text:='actvty_rgn'; --partition COLUMN
      p_sub_part_type text:='list';  -- partition type range,list, hash
      p_sub_part_interval text:= 'monthly'; --time/date:  daily, monthly,yearly , id : 10,1000 any range, list = 'west,north,south,east', maduler = 5,10,20 etc;

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors