Greenplum 自定义复合类型 数组

本文涉及的产品
RDS MySQL DuckDB 分析主实例,基础系列 4核8GB
RDS MySQL DuckDB 分析主实例,集群系列 4核8GB
RDS AI 助手,专业版
简介:

标签

PostgreSQL , Greenplum , composite type array


背景

如果你现在要在Greenplum中创建一个复合类型,是不会自动给你创建对应的数组类型的。(而实际上PostgreSQL 在2007年已经支持了这个功能)

Greenplum需要等到5.0,才能使用上它了。

https://github.com/greenplum-db/gpdb/commit/8954a537ee6199a80c38581fd3cd7ed463abbdea

Support arrays of composite types  
Backport from upstream with this commit:  
  
    commit bc8036f  
    Author: Tom Lane <tgl@sss.pgh.pa.us>  
    Date:   Fri May 11 17:57:14 2007 +0000  
  
        Support arrays of composite types, including the rowtypes of regular tables  
        and views (but not system catalogs, nor sequences or toast tables).  Get rid  
        of the hardwired convention that a type's array type is named exactly "_type",  
        instead using a new column pg_type.typarray to provide the linkage.  (It still  
        will be named "_type", though, except in odd corner cases such as  
        maximum-length type names.)  
  
        Along the way, make tracking of owner and schema dependencies for types more  
        uniform: a type directly created by the user has these dependencies, while a  
        table rowtype or auto-generated array type does not have them, but depends on  
        its parent object instead.  
  
        David Fetter, Andrew Dunstan, Tom Lane  
 master (#1)  5.0.0-alpha.1 5.0.0-alpha.0  
1 parent 5b33bee commit 8954a537ee6199a80c38581fd3cd7ed463abbdea @HaozhouWang HaozhouWang committed on 9 Mar 2016  

https://www.postgresql.org/docs/8.2/static/sql-createtype.html

Array Types

Whenever a user-defined base data type is created, PostgreSQL automatically creates an associated array type,   
whose name consists of the base type's name prepended with an underscore.   
The parser understands this naming convention, and translates requests for columns of type foo[] into requests for type _foo.   
The implicitly-created array type is variable length and uses the built-in input and output functions array_in and array_out.  
  
You might reasonably ask why there is an ELEMENT option, if the system makes the correct array type automatically.   
The only case where it's useful to use ELEMENT is when you are making a fixed-length type that happens to be internally an array of a number of identical things,  
and you want to allow these things to be accessed directly by subscripting, in addition to whatever operations you plan to provide for the type as a whole.   
For example, type name allows its constituent char elements to be accessed this way.   
A 2-D point type could allow its two component numbers to be accessed like point[0] and point[1].   
  
Note that this facility only works for fixed-length types whose internal form is exactly a sequence of identical fixed-length fields.   
A subscriptable variable-length type must have the generalized internal representation used by array_in and array_out. For historical reasons   
(i.e., this is clearly wrong but it's far too late to change it),   
subscripting of fixed-length array types starts from zero, rather than from one as for variable-length arrays.  
相关实践学习
使用PolarDB和ECS搭建门户网站
本场景主要介绍如何基于PolarDB和ECS实现搭建门户网站。
阿里云数据库产品家族及特性
阿里云智能数据库产品团队一直致力于不断健全产品体系,提升产品性能,打磨产品功能,从而帮助客户实现更加极致的弹性能力、具备更强的扩展能力、并利用云设施进一步降低企业成本。以云原生+分布式为核心技术抓手,打造以自研的在线事务型(OLTP)数据库Polar DB和在线分析型(OLAP)数据库Analytic DB为代表的新一代企业级云原生数据库产品体系, 结合NoSQL数据库、数据库生态工具、云原生智能化数据库管控平台,为阿里巴巴经济体以及各个行业的企业客户和开发者提供从公共云到混合云再到私有云的完整解决方案,提供基于云基础设施进行数据从处理、到存储、再到计算与分析的一体化解决方案。本节课带你了解阿里云数据库产品家族及特性。
目录
相关文章
|
17天前
|
人工智能 自然语言处理 Shell
🦞 如何在 OpenClaw (Clawdbot/Moltbot) 配置阿里云百炼 API
本教程指导用户在开源AI助手Clawdbot中集成阿里云百炼API,涵盖安装Clawdbot、获取百炼API Key、配置环境变量与模型参数、验证调用等完整流程,支持Qwen3-max thinking (Qwen3-Max-2026-01-23)/Qwen - Plus等主流模型,助力本地化智能自动化。
31310 109
🦞 如何在 OpenClaw (Clawdbot/Moltbot) 配置阿里云百炼 API
|
7天前
|
应用服务中间件 API 网络安全
3分钟汉化OpenClaw,使用Docker快速部署启动OpenClaw(Clawdbot)教程
2026年全新推出的OpenClaw汉化版,是基于Claude API开发的智能对话系统本土化优化版本,解决了原版英文界面的使用壁垒,实现了界面、文档、指令的全中文适配。该版本采用Docker容器化部署方案,开箱即用,支持Linux、macOS、Windows全平台运行,适配个人、企业、生产等多种使用场景,同时具备灵活的配置选项和强大的扩展能力。本文将从项目简介、部署前准备、快速部署、详细配置、问题排查、监控维护等方面,提供完整的部署与使用指南,文中包含实操代码命令,确保不同技术水平的用户都能快速落地使用。
4530 1
|
13天前
|
人工智能 安全 机器人
OpenClaw(原 Clawdbot)钉钉对接保姆级教程 手把手教你打造自己的 AI 助手
OpenClaw(原Clawdbot)是一款开源本地AI助手,支持钉钉、飞书等多平台接入。本教程手把手指导Linux下部署与钉钉机器人对接,涵盖环境配置、模型选择(如Qwen)、权限设置及调试,助你快速打造私有、安全、高权限的专属AI助理。(239字)
6528 17
OpenClaw(原 Clawdbot)钉钉对接保姆级教程 手把手教你打造自己的 AI 助手
|
12天前
|
人工智能 机器人 Linux
OpenClaw(Clawdbot、Moltbot)汉化版部署教程指南(零门槛)
OpenClaw作为2026年GitHub上增长最快的开源项目之一,一周内Stars从7800飙升至12万+,其核心优势在于打破传统聊天机器人的局限,能真正执行读写文件、运行脚本、浏览器自动化等实操任务。但原版全英文界面对中文用户存在上手门槛,汉化版通过覆盖命令行(CLI)与网页控制台(Dashboard)核心模块,解决了语言障碍,同时保持与官方版本的实时同步,确保新功能最快1小时内可用。本文将详细拆解汉化版OpenClaw的搭建流程,涵盖本地安装、Docker部署、服务器远程访问等场景,同时提供环境适配、问题排查与国内应用集成方案,助力中文用户高效搭建专属AI助手。
4576 9
|
14天前
|
人工智能 机器人 Linux
保姆级 OpenClaw (原 Clawdbot)飞书对接教程 手把手教你搭建 AI 助手
OpenClaw(原Clawdbot)是一款开源本地AI智能体,支持飞书等多平台对接。本教程手把手教你Linux下部署,实现数据私有、系统控制、网页浏览与代码编写,全程保姆级操作,240字内搞定专属AI助手搭建!
5533 19
保姆级 OpenClaw (原 Clawdbot)飞书对接教程 手把手教你搭建 AI 助手
|
14天前
|
存储 人工智能 机器人
OpenClaw是什么?阿里云OpenClaw(原Clawdbot/Moltbot)一键部署官方教程参考
OpenClaw是什么?OpenClaw(原Clawdbot/Moltbot)是一款实用的个人AI助理,能够24小时响应指令并执行任务,如处理文件、查询信息、自动化协同等。阿里云推出的OpenClaw一键部署方案,简化了复杂配置流程,用户无需专业技术储备,即可快速在轻量应用服务器上启用该服务,打造专属AI助理。本文将详细拆解部署全流程、进阶功能配置及常见问题解决方案,确保不改变原意且无营销表述。
6056 5
|
16天前
|
人工智能 JavaScript 应用服务中间件
零门槛部署本地AI助手:Windows系统Moltbot(Clawdbot)保姆级教程
Moltbot(原Clawdbot)是一款功能全面的智能体AI助手,不仅能通过聊天互动响应需求,还具备“动手”和“跑腿”能力——“手”可读写本地文件、执行代码、操控命令行,“脚”能联网搜索、访问网页并分析内容,“大脑”则可接入Qwen、OpenAI等云端API,或利用本地GPU运行模型。本教程专为Windows系统用户打造,从环境搭建到问题排查,详细拆解全流程,即使无技术基础也能顺利部署本地AI助理。
7694 17
|
10天前
|
人工智能 JavaScript 安全
Claude Code 安装指南
Claude Code 是 Anthropic 推出的本地 AI 编程助手,支持 Mac/Linux/WSL/Windows 多平台一键安装(Shell/PowerShell/Homebrew/NPM),提供 CLI 交互、代码生成、审查、Git 提交等能力,并内置丰富斜杠命令与自动更新机制。
3843 0