postgresql - 我们如何在 postgresql 的列表分区中存储其他值
问题描述
我们如何在 postgresql 的列表分区中存储其他值?
示例:如何在下表中为不同于 (1,2,3,4) 的值添加分区。
CREATE TABLE countrymeasurements
(
countrycode int NOT NULL,
countryname character varying(30) NOT NULL,
languagename character varying (30) NOT NULL,
daysofoperation character varying(30) NOT NULL,
salesparts bigint,
replaceparts bigint
)
PARTITION BY LIST(countrycode);
Define the partitions:
create table india
partition of countrymeasurements
for values in (1);
create table japan
partition of countrymeasurements
for values in (2);
create table china
partition of countrymeasurements
for values in (3);
create table malaysia
partition of countrymeasurements
for values in (4);
解决方案
现在找到了解决方案:
create table dwh_user.countrymeasurements_def
partition of countrymeasurements
default;
推荐阅读
- android - 数组适配器显示错误的项目无法绘制谷歌地图路线
- r - 更快相当于 group_by %>% 在 R 中展开
- java - 避免在从 Enum 填充的 ChoiceBox 中进行未经检查的强制转换
- kubernetes - OpenShift / OKD 为每个 Pod Replica 指定 URL
- angular - 如何将项目添加到角度 6 的列表中?
- java - 你如何摆脱对实现接口的多余强制转换?
- here-api - 如何解释 ADAS_ATTRIB 属性 vertical_flags
- kotlin - 从挂起的函数启动协程
- python - 获取文档向量值的正确方法是什么?
- reactjs - 使用 react-router-dom 重定向到第三方 url