Greenplum按范围将多个分区添加到现有表

问题描述

我无法决定通过此documentation

将分区添加到Pivotal Greenplum中的现有分区表中
create table tab_name
(
    day_dt date,id text,s_id text,type text,amt numeric(19,4)
)
distributed randomly
partition by range (day_dt)
    (
    start (date '2020-09-18') inclusive
    end (date '2020-10-02') exclusive
    every (interval '1 day')
    );

这是DDL。 从2020-10-02开始,我需要在每个新的一天中添加新分区,然后才能向表中添加数据。

ALTER TABLE tab_name ADD PARTITION
             START (date '2020-10-02') INCLUSIVE
             END (date '2020-11-01') EXCLUSIVE;

但是这个分区只会创建一个分区,我每天都需要。

解决方法

我不知道任何/Users/Prateek/ionicApps/muniFlores/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m:141:27: error: property 'defaultWebpagePreferences' not found on object of type 'WKWebViewConfiguration *' configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeMobile; ^ /Users/Prateek/ionicApps/muniFlores/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m:141:76: error: use of undeclared identifier 'WKContentModeMobile' configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeMobile; ^ /Users/Prateek/ionicApps/muniFlores/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m:143:27: error: property 'defaultWebpagePreferences' not found on object of type 'WKWebViewConfiguration *' configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeDesktop; ^ /Users/Prateek/ionicApps/muniFlores/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m:143:76: error: use of undeclared identifier 'WKContentModeDesktop' configuration.defaultWebpagePreferences.preferredContentMode = WKContentModeDesktop; 命令的变体,它允许递归添加多个分区。我了解您一次只能在现有分区模式的“边缘”添加一个分区。

关于如何实现自己描述的内容的一些想法包括:

  • 发出多个ALTER TABLE ... ADD PARTITION语句(可能包含在一个函数中,该语句将允许您执行递归操作)
  • 在添加/交换/拆分新分区之前,为所有不在(2020-09-18,2020-10-02)范围内的日期添加默认分区