爆款云主机低至25.83元/年
查看详情

活动

天翼云最新优惠活动,涵盖免费试用,产品折扣等,助您降本增效!
热门活动
  • 云聚517 · 好价翼起拼 NEW 爆款云主机低至25.83元/年,参与拼团享更多优惠,拼成得额外优惠券
  • 安全隔离版OpenClaw NEW OpenClaw云服务器专属“龙虾“套餐低至1.5折起
  • 聚力AI赋能 天翼云大模型专项 大模型特惠专区·Token Plan 轻享包低至9.9元起
  • 青云志云端助力计划 NEW 一站式科研助手,海外资源安全访问平台,助力青年翼展宏图,平步青云
  • 企业出海解决方案 NEW 助力您的业务扬帆出海,通达全球!
  • 天翼云信创专区 NEW “一云多芯、一云多态”,国产化软件全面适配,国产操作系统及硬件芯片支持丰富
  • 中小企业服务商合作专区 国家云助力中小企业腾飞,高额上云补贴重磅上线
  • 云上钜惠 爆款云主机全场特惠,2核4G只要1.8折起!
  • 天翼云奖励推广计划 加入成为云推官,推荐新用户注册下单得现金奖励
免费活动
  • 免费试用中心 HOT 多款云产品免费试用,快来开启云上之旅
  • 天翼云用户体验官 NEW 您的洞察,重塑科技边界

息壤智算

领先开放的智算服务平台,提供算力、平台、数据、模型、应用“五位一体”智算服务体系,构建全流程的AI基础设施能力
AI Store
  • 算力市场
  • 模型市场
  • 应用市场
公共算力服务
  • 裸金属
  • 定制裸金属
训推服务
  • 模型开发
  • 训练任务
  • 服务部署
Token服务
  • 模型广场
  • 体验中心
  • 服务接入
应用托管
  • 应用实例
科研助手
  • 科研智能体
  • 科研服务
  • 开发机
  • 并行计算
大模型
  • DeepSeek-V4-Flash
  • GLM-5.1
  • Qwen3.5-122B-A10B
  • DeepSeek-V3.2(旗舰版)
  • GLM-5(正式版)
智算一体机
  • 智算一体机
智能体引擎
  • 智能体引擎
模型适配专家服务
  • 模型适配专家服务
算力服务商
  • 入驻算力服务商

应用商城

天翼云精选行业优秀合作伙伴及千余款商品,提供一站式云上应用服务
进入甄选商城进入云市场进入AI Store创新解决方案公有云生态专区智云上海应用生态专区
建站工具
  • 新域名服务
  • SSL证书
  • 翼建站
企业办公
  • 安全邮箱
  • WPS 365 天翼云版
  • 天翼企业云盘(标准服务版)
灾备迁移
  • 云管家2.0
  • 翼备份(SaaS版)

定价

协助您快速了解云产品计费模式、价格详情,轻松预估上云成本
价格计算器
  • 动态测算产品价格
定价策略
  • 快速了解计费模式

合作伙伴

天翼云携手合作伙伴,共创云上生态,合作共赢
天翼云生态合作中心
  • 天翼云生态合作中心
天翼云渠道合作伙伴
  • 天翼云代理渠道合作伙伴
天翼云服务合作伙伴
  • 天翼云集成商交付能力认证
天翼云应用合作伙伴
  • 天翼云云市场合作伙伴
  • 天翼云甄选商城合作伙伴
天翼云技术合作伙伴
  • 天翼云OpenAPI中心
天翼云培训认证
  • 天翼云学堂
  • 天翼云市场商学院
天翼云合作计划
  • 云汇计划
天翼信创云专区
  • 信创云专区
  • 适配互认证

开发者

开发者相关功能入口汇聚
技术社区
  • 专栏文章
  • 互动问答
  • 技术视频
资源与工具
  • OpenAPI中心
培训与认证
  • 天翼云学堂
  • 天翼云认证
开源社区
  • 魔乐社区
  • OpenTeleDB

支持与服务

为您提供全方位支持与服务,全流程技术保障,助您轻松上云,安全无忧
文档与工具
  • 文档中心
  • 新手上云
  • 自助服务
  • OpenAPI中心
定价
  • 价格计算器
  • 定价策略
基础服务
  • 售前咨询
  • 在线支持
  • 在线支持
  • 工单服务
  • 服务保障
  • 会员中心
增值服务
  • 红心服务
  • 首保服务
  • 客户支持计划
  • 专家技术服务
  • 备案管家
我要反馈
  • 建议与反馈
  • 用户体验官
信息公告
  • 客户公告

了解天翼云

天翼云秉承央企使命,致力于成为数字经济主力军,投身科技强国伟大事业,为用户提供安全、普惠云服务
品牌介绍
  • 关于天翼云
  • 智算云
  • 天翼云4.0
  • 新闻资讯
  • 天翼云APP
基础设施
  • 全球基础设施
  • 信任中心
最佳实践
  • 精选案例
  • 超级探访
  • 云杂志
  • 分析师和白皮书
  • 天翼云·创新直播间
市场活动
  • 2026智能云生态大会
  • 2025智能云生态大会
  • 2024智算云生态大会
  • 2023云生态大会
  • 2022云生态大会
  • 天翼云中国行
天翼云
  • 活动
  • 息壤智算
  • 产品
  • 解决方案
  • 应用商城
  • 定价
  • 合作伙伴
  • 开发者
  • 支持与服务
  • 了解天翼云
      • 文档
      • 控制中心
      • 备案
      • 管理中心
      分析型数据库PostgreSql_相关内容
      • 禁用或启用定时任务
        本页为您介绍如何禁用或启用定时任务。 broken(jobno bigint,broken bool):第一个参数是定时任务的jodid;第二个参数是启用、禁用定时任务,true表示启用,false表示禁用。具体表现在job表的active字段。active为false表示禁用。 plaintext select dbmsjob.broken(20002,false); 禁用jobid为20002的定时任务 select dbmsjob.broken(20002, true); 启用jobid为20002的定时任务 期望结果,查询dbmsjob.job表中的jobid为20002的定时任务的active字段为falsetrue 启用定时任务 run(jobno bigint):第一个参数是定时任务的jodid;具体表现在job表的active字段。 plaintext select dbmsjob.run(25002); 启用jobid为25002的定时任务。
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        定时任务
        禁用或启用定时任务
      • 删除定时任务
        本页为您介绍如何删除定时任务。 unschedule(jobno bigint):第一个参数是定时任务的jodid。 plaintext select dbmsjob.unschedule(20002); 删除jobid为20002的定时任务 期望结果,查询dbmsjob.job表发现jobid为20002的定时任务不存在
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        定时任务
        删除定时任务
      • 查询定时任务以及执行记录
        本页为您介绍如何查询定时任务以及执行记录。 plaintext select from dbmsjob.job; 查询定时任务 select from dbmsjob.joblog; 查询定时任务的执行记录
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        定时任务
        查询定时任务以及执行记录
      • 初始化实例
        本页为您介绍初始化实例的操作步骤。 1. 通过pgxcctl新建一个双CN、双DN的实例,并开启服务。 2. 通过telesql连接到CN节点。 3. 执行sql “create default node group defaultgroup with(dn01, dn02); create sharding group to group defaultgroup;”。
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        闪回恢复
        初始化实例
      • 创建插件
        本页为您介绍创建插件的操作步骤。 1. 通过telesql连接到CN节点。 2. 执行sql “create extension pgtrashcan;” 3. 执行telesql命令dx,查看插件pgtrashcan是否存在。
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        闪回恢复
        创建插件
      • 创建表并插入数据
        本页为您介绍创建表并插入数据的方法。 plaintext teledb CREATE TABLE foo (bar bigint, baz text); CREATE TABLE teledb ALTER TABLE foo SET (autovacuumenabled false, toast.autovacuumenabled false); ALTER TABLE teledb INSERT INTO foo VALUES (1, 'aaa'), (2, 'bbb'),(3,'ccc'); INSERT 0 3
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        闪回查询
        创建表并插入数据
      • 初始化实例
        本页为您介绍初始化实例的操作步骤。 1. 通过pgxcctl新建一个双CN、双DN的实例,并开启服务。 2. 通过telesql连接到CN节点。 3. 执行sql “create default node group defaultgroup with(dn01, dn02); create sharding group to group defaultgroup;”。
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        闪回查询
        初始化实例
      • gin索引
        本文为您介绍如何使用gin索引。 pgtrgm索引 注意 此功能需加载插件 pgtrgm。 teledb drop index ttrgmtrgmidx; DROP INDEX teledb create index ttrgmtrgmidx on ttrgm using gin(trgm gintrgmops); CREATE INDEX jsonb索引 teledb create table tjsonb(id int,fjsonb jsonb); CREATE TABLE teledb create index tjsonbfjsonbidx on tjsonb using gin(fjsonb); CREATE INDEX 数组索引 teledb create table tarray(id int, mc text[]); CREATE TABLE teledb insert into tarray select t,('{'md5(t::text)'}')::text[] from generateseries(1,1000000) as t; INSERT 0 1000000 teledb analyze; ANALYZE teledb timing Timing is on. teledb explain select from tarray where mc @> ('{'md5('1')'}')::text[]; QUERY PLAN Remote Fast Query Execution (cost0.00..0.00 rows0 width0) Node/s: dn01, dn02 > Gather (cost1000.00..13094.09 rows2503 width61) Workers Planned: 2 > Parallel Seq Scan on tarray (cost0.00..11843.79 rows1043 width61) Filter: (mc @> ((('{'::text 'c4ca4238a0b923820dcc509a6f75849b'::text) '}'::text))::text[]) (6 rows) Time: 21.368 ms teledb select from tarray where mc @> ('{'md5('1')'}')::text[]; id mc + 1 {c4ca4238a0b923820dcc509a6f75849b} (1 row) Time: 431.788 ms teledb
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DDL操作
        索引管理
        gin索引
      • 特殊应用
        本文为您介绍SELECT语法的特殊应用场景,例如多行变成单行和一列变成多行。 多行变成单行 teledb select arraytostring(array(select nickname from teledbpg1),','); arraytostring test,pg (1 row) 一列变成多行 teledb insert into teledbpg1 values(6, 'teledb, teledb1'); INSERT 0 1 teledb select regexpsplittotable((select nickname from teledbpg1 where id6 limit 1), ','); regexpsplittotable teledb teledb1 (2 rows)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        特殊应用
      • 查询元数据表
        本页为您介绍如何查询元数据表。 1. 通过telesql连接到CN节点。 2. 执行psql命令 “dn”,查看schema trash是否存在。 3. 执行psql命令 “dt trash.”,查看元数据表trashtable是否存在 4. 执行sql “select from trash.trashtable;”。
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        闪回恢复
        查询元数据表
      • 查询所有历史数据
        本页为您介绍查询所有历史数据的方法。 plaintext teledb SELECT pgxactcommittimestamp(xmin) as xmintime, pgxactcommittimestamp(case xmax when 0 then null else xmax end) as xmaxtime, FROM pgdirtyread('foo') AS t(tableoid oid, ctid tid, xmin xid, xmax xid, cmin cid, cmax cid, dead boolean,bar bigint, baz text); xmintime xmaxtime tableoid ctid xmin xmax cmin cmax dead bar baz ++++++++++ 20231102 16:42:15.694944+08 20231102 16:42:22.213469+08 16432 (0,1) 677 678 0 0 t 1 aaa 20231102 16:42:15.694944+08 20231102 16:42:28.684133+08 16432 (0,2) 677 679 0 0 t 2 bbb 20231102 16:42:47.230036+08 16432 (0,3) 680 0 0 0 f 5 eee 20231102 16:42:54.18001+08 20231102 16:43:00.369209+08 16432 (0,4) 681 682 0 0 f 6 fff 20231102 16:42:15.694944+08 20231102 16:42:34.764626+08 16432 (0,1) 657 658 0 0 t 3 ccc 20231102 16:42:34.764626+08 20231102 16:42:41.46109+08 16432 (0,2) 658 659 0 0 f 3 cccnew 20231102 16:42:41.46109+08 16432 (0,3) 659 0 0 0 f 3 cccnew2 (7 rows)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        闪回查询
        查询所有历史数据
      • 创建插件
        本页为您介绍创建插件的操作步骤。 1. 通过telesql连接到CN节点。 2. 执行sql “create extension pgdirtyread;” 3. 执行telesql命令dx,查看插件pgdirtyread是否存在。
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        闪回查询
        创建插件
      • 合并多个查询结果
        本文为你介绍合并多个查询结果的方法。 不过滤重复的记录。 teledb create table teledbpg1(id int, nickname varchar); CREATE TABLE teledb insert into teledbpg1 values(3, 'pg'),(5,'test'); COPY 2 teledb select from teledbpg union all select from teledbpg1; id nickname + 1 teledb 1 hello,pgxc 2 TELEDB 3 pg 4 5 test 3 pg (7 rows) 过滤重复的记录。 teledb select from teledbpg union select from teledbpg1; id nickname + 1 teledb 1 hello,pgxc 4 5 test 2 TELEDB 3 pg (6 rows) 每个子查询分布在合并结果中的使用。 teledb select from (select from teledbpg limit 2) as t union all select from (select from teledbpg1 limit 2) teledb ; id nickname + 1 teledb 1 hello,pgxc 5 test 3 pg (4 rows)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        合并多个查询结果
      • 表达式索引
        本文为您介绍如何管理表达式索引。 teledb create table tupper(id int,mc text); CREATE TABLE teledb create index tuppermc on tupper(mc); CREATE INDEX teledb insert into tupper select t,md5(t::text) from generateseries(1,10000) as t; INSERT 0 10000 teledb analyze tupper; ANALYZE teledb explain select from tupper where upper(mc)md5('1'); QUERY PLAN Remote Fast Query Execution (cost0.00..0.00 rows0 width0) Node/s: dn01, dn02 > Seq Scan on tupper (cost0.00..133.58 rows25 width37) Filter: (upper(mc) 'c4ca4238a0b923820dcc509a6f75849b'::text) (4 rows) teledb create index tuppermc on tupper(upper(mc)); ERROR: relation "tuppermc" already exists teledb create index tuppermc1 on tupper(upper(mc)); CREATE INDEX teledb explain select from tupper where upper(mc)md5('1'); QUERY PLAN Remote Fast Query Execution (cost0.00..0.00 rows0 width0) Node/s: dn01, dn02 > Bitmap Heap Scan on tupper (cost4.48..50.94 rows25 width37) Recheck Cond: (upper(mc) 'c4ca4238a0b923820dcc509a6f75849b'::text) > Bitmap Index Scan on tuppermc1 (cost0.00..4.47 rows25 width0) Index Cond: (upper(mc) 'c4ca4238a0b923820dcc509a6f75849b'::text) (6 rows)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DDL操作
        索引管理
        表达式索引
      • not in中包含了null,结果全为真
        本文介绍使用SELECT语法时,not in中包含了null,结果全为真的场景。 teledb select from teledbpg where id not in (1,3); id nickname + 2 TELEDB 4 (2 rows) teledb select from teledbpg where id not in (1,3,null); id nickname + (0 rows)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        not in中包含了null,结果全为真
      • 只查某个DN的数据
        本文介绍只查询某个DN数据的操作。 teledb execute direct on (dn01) 'select from teledbpg'; id nickname + 1 teledb 1 hello,pgxc 2 TELEDB (3 rows) teledb execute direct on (dn02) 'select from teledbpg'; id nickname + 3 pg 4 (2 rows)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        只查某个DN的数据
      • 聚集查询
        本文介绍如何在使用SELECT语法时进行聚集查询,例如统计记录数、不重复值的记录表,以及求和等。 统计记录数。 teledb select count(1) from teledbpg; count 5 (1 row) 统计不重复值的记录表。 teledb select count(distinct id) from teledbpg; count 4 (1 row) 求和。 teledb select sum(id) from teledbpg; sum 11 (1 row) 求最大值。 teledb select max(id) from teledbpg; max 4 (1 row) 求最小值。 teledb select min(id) from teledbpg; min 1 (1 row) 求平均值。 teledb select avg(id) from teledbpg; avg 2.2000000000000000 (1 row)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        聚集查询
      • all 用法
        本文介绍如何在使用SELECT语法时添加all条件。 需要大于所有值才为真。 teledb select from teledbpg where id > all (select 1 union select 3); id nickname + 4 (1 row)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        all 用法
      • 删除数据表
        本文为您介绍如何删除数据表。 删除当前模式下的数据表。 teledb drop table t; DROP TABLE 删除某个模式下数据表。 teledb d+ t Table "public.t" Column Type Collation Nullable Default Storage Stats target Description +++++++ id integer plain mc text extended Distribute By: SHARD(id) Location Nodes: ALL DATANODES teledb d+ tas Table "public.tas" Column Type Collation Nullable Default Storage Stats target Description +++++++ id integer plain mc text extended Distribute By: SHARD(id) Location Nodes: ALL DATANODES teledb drop table public.test; DROP TABLE 删除数据表,当表不存在时不执行该操作,也不会报错。 teledb drop table IF EXISTS t; NOTICE: table "t" does not exist, skipping DROP TABLE 使用CASCADE无条件删除数据表。 teledb create view shardview as select from testshard; CREATE VIEW teledb drop table testshard; ERROR: cannot drop table testshard because other objects depend on it DETAIL: view shardview depends on table testshard HINT: Use DROP ... CASCADE to drop the dependent objects too. teledb drop table testshard cascade; NOTICE: drop cascades to view shardview DROP TABLE
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DDL操作
        数据表管理
        删除数据表
      • 多表关联
        本文为您介绍SELECT语法中多表关联的使用方法。 内连接 teledb select from teledbpg inner join teledbpg1 on teledbpg.id teledbpg1.id; id nickname id nickname +++ 3 pg 3 pg (1 row) 左外连接 teledb select from teledbpg left join teledbpg1 on teledbpg.id teledbpg1.id; id nickname id nickname +++ 1 teledb 1 hello,pgxc 2 TELEDB 3 pg 3 pg 4 (5 rows) 右外连接 teledb select from teledbpg right join teledbpg1 on teledbpg.id teledbpg1.id; id nickname id nickname +++ 5 test 3 pg 3 pg (2 rows) 全连接 teledb select from teledbpg full join teledbpg1 on teledbpg.id teledbpg1.id; id nickname id nickname +++ 1 teledb 3 pg 3 pg 4 1 hello,pgxc 2 TELEDB 5 test (6 rows)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        多表关联
      • where 条件使用
        exists 只要有记录返回就为真 teledb select from teledbpg where exists(select from person where person.id teledbpg.id); id nickname + 1 teledb 1 hello,pgxc 2 TELEDB 3 pg (4 rows) exists 等价写法 teledb select teledbpg. from teledbpg, (select distinct id from person) as t where t.id teledbpg.id; id nickname + 1 teledb 1 hello,pgxc 2 TELEDB 3 pg (4 rows)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        where 条件使用
      • 自定义复合类型
        本文为您介绍如何增加一个复合类型。 增加一个复合类型 teledb create type mytype as (f1 int,f2 varchar(10)); CREATE TYPE
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DDL操作
        自定义复合类型
      • jsonb应用
        创建jsonb类型字段表 teledb create table tjsonb(id int,fjsonb jsonb); CREATE TABLE 插入数据 teledb insert into tjsonb values(1,'{"col1":1,"col2":"teledb"}'); INSERT 0 1 teledb insert into tjsonb values(2,'{"col1":1,"col2":"teledb","col3":"pgxz"}'); INSERT 0 1 teledb select from tjsonb; id fjsonb + 1 {"col1": 1, "col2": "teledb"} 2 {"col1": 1, "col2": "teledb", "col3": "pgxz"} (2 rows jsonb插入时会移除重复的键,如下所示。 teledb insert into tjsonb values(3,'{"col1":1,"col2":"teledb","col2":"pgxz"}'); INSERT 0 1 teledb select from tjsonb; id fjsonb + 1 {"col1": 1, "col2": "teledb"} 2 {"col1": 1, "col2": "teledb", "col3": "pgxz"} 3 {"col1": 1, "col2": "pgxz"} (3 rows) 更新数据 增加元素。 teledb update tjsonb set fjsonb fjsonb '{"col3":"pgxz"}'::jsonb where id1; UPDATE 1 teledb select from tjsonb; id fjsonb + 2 {"col1": 1, "col2": "teledb", "col3": "pgxz"} 1 {"col1": 1, "col2": "teledb", "col3": "pgxz"} 3 {"col1": 1, "col2": "pgxz"} (3 rows) 更新原来的元素。 teledb
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        json和jsonb使用
        jsonb应用
      • json 应用
        创建json 类型字段表 teledb create table tjson(id int,fjson json); CREATE TABLE 插入数据 teledb insert into tjson values(1,'{"col1":1,"col2":"teledb"}'); INSERT 0 1 teledb insert into tjson values(2,'{"col1":1,"col2":"teledb","col3":"pgxz"}'); INSERT 0 1 teledb select from tjson; id fjson + 1 {"col1":1,"col2":"teledb"} 2 {"col1":1,"col2":"teledb","col3":"pgxz"} (2 rows) 通过键获得json对象域 teledb select fjson >'col2' as col2 ,fjson > 'col3' as col3 from tjson; col2 col3 + "teledb" "teledb" "pgxz" (2 rows) 以文本形式获取对象值 teledb select fjson >>'col2' as col2 ,fjson >> 'col3' as col3 from tjson; col2 col3 + teledb teledb pgxz (2 rows) teledb select fjson >>'col2' as col2 ,fjson >> 'col3' as col3 from tjson where fjson >> 'col3' is not null; col2 col3 + teledb pgxz (1 row)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        json和jsonb使用
        json 应用
      • 聚合函数并发计算
        本文介绍如何在使用SELECT语法时进行聚合函数并发计算。 teledb set maxparallelworkerspergather to 0; SET Time: 0.214 ms teledb select count(1) from tcount; count 20000000 (1 row) Time: 2700.569 ms (00:02.701) teledb set maxparallelworkerspergather to 2; SET Time: 0.269 ms teledb select count(1) from tcount; count 20000000 (1 row) Time: 1867.719 ms (00:01.868)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        聚合函数并发计算
      • 返回两个结果的交集
        本文介绍如何在使用SELECT语法时,返回两个结果的交集。 teledb select from teledbpg intersect select from teledbpg1; id nickname + 3 pg (1 row)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        返回两个结果的交集
      • 返回两个结果的差集
        本文介绍如何在使用SELECT语法时,返回两个结果的差集。 teledb select from teledbpg except select from teledbpg1; id nickname + 2 TELEDB 4 1 teledb 1 hello,pgxc (4 rows)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DML操作
        SELECT语法
        返回两个结果的差集
      • 视图管理
        本文为您介绍如何管理视图,包括创建视图、删除视图和物化视图使用。 创建视图 teledb create view trangeview as select from trange; CREATE VIEW teledb select from trangeview; f1 f2 f3 ++ 1 20230822 11:06:16.9783 1 2 20230822 11:06:16.9783 50 2 20230822 11:06:16.9783 110 3 20230822 11:06:16.9783 100 (4 rows) 数据类型重定义。 teledb drop view trangeview; DROP VIEW teledb create view trangeview as select f1,f2::date from trange; CREATE VIEW teledb select from trangeview; f1 f2 + 1 20230822 3 20230822 2 20230822 2 20230822 (4 rows) 数据类型重定义,以及取别名。 teledb drop view trangeview; DROP VIEW teledb create view trangeview as select f1,f2::date as mydate from trange; CREATE VIEW teledb select from trangeview; f1 mydate + 1 20230822 2 20230822 2 20230822 3 20230822 (4 rows) TeleDB 支持视图引用表或字段改名联动,不受影响。 teledb d+ trangeview View "teledb.trangeview" Column Type Collation Nullable Default Storage Description ++++++ f1 bigint plain mydate date plain View definition: SELECT trange.f1, trange.f2::date AS mydate FROM trange; teledb
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DDL操作
        视图管理
      • 分区表全局索引
        本文为您介绍如何管理分区表全局索引。 支持创建分区表全局索引,目前仅支持btree索引类型 建表 CREATE TABLE parentrangetbl( c1 int not null, c2 int not null, c3 int not null ) PARTITION BY RANGE (c1); CREATE TABLE part0100 PARTITION OF parentrangetbl FOR VALUES FROM (0) TO (100); CREATE TABLE part100200 PARTITION OF parentrangetbl FOR VALUES FROM (100) TO (200); CREATE TABLE partdefault PARTITION OF parentrangetbl DEFAULT; 插入数据 INSERT INTO parentrangetbl(c1,c2,c3) SELECT generateseries(50, 100) AS c1, generateseries(50, 100) AS c2, generateseries(50, 100) AS c3; 创建全局索引 CREATE INDEX c3globalidx ON parentrangetbl(c3) GLOBAL; 设置不使用seq scan set enableseqscan TO off; 通过全局索引查询数据 EXPLAIN SELECT c3 FROM parentrangetbl WHERE c3 > 70 AND c3 Index Only Scan using c3globalidx on parentrangetbl (cost0.12..8.14 rows9 width4) Index Cond: ((c3 > 70) AND (c3 < 75)) (3 rows)
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DDL操作
        索引管理
        分区表全局索引
      • 唯一索引
        本文为您介绍如何创建唯一索引。 创建唯一索引 teledb create unique index tasiduidx on tas using btree(id); CREATE INDEX 非shard key 字段不能建立唯一索引 teledb create unique index tasiduidx on tas using btree(mc); ERROR: Unique index of partitioned table must contain the hash/modulo distribution column.
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DDL操作
        索引管理
        唯一索引
      • 使用 IF NOT EXISTS
        本页为您介绍如何使用使用 IF NOT EXISTS关键字。 带IF NOT EXISTS 关键字作用表示表不存在时才创建。 teledb create table t(id int,mc text); CREATE TABLE teledb create table t(id int,mc text); ERROR: relation "t" already exists teledb create table IF NOT EXISTS t(id int,mc text); NOTICE: relation "t" already exists, skipping CREATE TABLE
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DDL操作
        数据表管理
        使用 IF NOT EXISTS
      • 逻辑分区表
        d+ tnativemullistgd Table "public.tnativemullistgd" Column Type Collation Nullable Default Storage Stats target Description ++++++ + f1 bigint not null nextval('tnativemullistf1seq'::regclass) plain f2 integer plain f3 text extended f4 text extended f5 timestamp(0) without time zone plain Partition of: tnativemullist FOR VALUES IN ('广东') Partition constraint: ((f3 IS NOT NULL) AND (f3 ANY (ARRAY['广东'::text]))) Partition key: RANGE (f5) Partitions: tnativemullistgd201701 FOR VALUES FROM ('20170101 00:00:00') TO ('20170201 00:00:00'), tnativemullistgd201702 FOR VALUES FROM ('20170201 00:00:00') TO ('20170301 00:00:00') Distribute By: SHARD(f1) Location Nodes: ALL DATANODES TeleDB支持存在1级和2级分区混用,大家不需要都平级。
        来自:
        帮助文档
        分布式融合数据库HTAP
        私有云产品
        开发手册
        数据库基础开发
        DDL操作
        数据表管理
        逻辑分区表
      • 1
      • ...
      • 282
      • 283
      • 284
      • 285
      • 286
      • ...
      • 287
      跳转至
      推荐热词
      天翼云运维管理审计系统天翼云云服务平台云服务备份云日志服务应用运维管理云手机云电脑天翼云云hbase数据库电信云大数据saas服务电信云大数据paas服务轻量型云主机天翼云客户服务电话应用编排服务天翼云云安全解决方案云服务总线CSB天翼云服务器配置天翼云联邦学习产品天翼云云安全天翼云企业上云解决方案天翼云产品天翼云视频云存储

      天翼云最新活动

      云聚517 · 好价翼起拼

      爆款云主机低至25.83元/年,参与拼团享更多优惠,拼成得额外优惠券

      安全隔离版OpenClaw

      OpenClaw云服务器专属“龙虾“套餐低至1.5折起

      聚力AI赋能 天翼云大模型专项

      大模型特惠专区·Token Plan 轻享包低至9.9元起

      青云志云端助力计划

      一站式科研助手,海外资源安全访问平台,助力青年翼展宏图,平步青云

      企业出海解决方案

      助力您的业务扬帆出海,通达全球!

      天翼云信创专区

      “一云多芯、一云多态”,国产化软件全面适配,国产操作系统及硬件芯片支持丰富

      中小企业服务商合作专区

      国家云助力中小企业腾飞,高额上云补贴重磅上线

      云上钜惠

      爆款云主机全场特惠,2核4G只要1.8折起!

      产品推荐

      弹性云主机 ECS

      弹性伸缩服务 AS

      训推服务

      公共算力服务

      应用托管

      一站式智算服务平台

      人脸检测

      人脸活体检测

      动作活体识别

      推荐文档

      产品定义

      什么是服务器迁移

      • 7*24小时售后
      • 无忧退款
      • 免费备案
      • 专家服务
      售前咨询热线
      400-810-9889转1
      关注天翼云
      • 旗舰店
      • 天翼云APP
      • 天翼云微信公众号
      服务与支持
      • 备案中心
      • 售前咨询
      • 智能客服
      • 自助服务
      • 工单管理
      • 客户公告
      • 涉诈举报
      账户管理
      • 管理中心
      • 订单管理
      • 余额管理
      • 发票管理
      • 充值汇款
      • 续费管理
      快速入口
      • 天翼云旗舰店
      • 文档中心
      • 最新活动
      • 免费试用
      • 信任中心
      • 天翼云学堂
      云网生态
      • 甄选商城
      • 渠道合作
      • 云市场合作
      了解天翼云
      • 关于天翼云
      • 天翼云APP
      • 服务案例
      • 新闻资讯
      • 联系我们
      热门产品
      • 云电脑
      • 弹性云主机
      • 云电脑政企版
      • 天翼云手机
      • 云数据库
      • 对象存储
      • 云硬盘
      • Web应用防火墙
      • 息壤智算平台
      • CDN加速
      热门推荐
      • 云服务备份
      • 边缘安全加速平台
      • 全站加速
      • 安全加速
      • 云服务器
      • 云主机
      • 智能边缘云
      • 应用编排服务
      • 微服务引擎
      • 共享流量包
      更多推荐
      • web应用防火墙
      • 密钥管理
      • 等保咨询
      • 安全专区
      • 应用运维管理
      • 云日志服务
      • 文档数据库服务
      • 云搜索服务
      • 数据湖探索
      • 数据仓库服务
      友情链接
      • 中国电信集团
      • 天翼云国际站
      • 189邮箱
      • 天翼企业云盘
      • 天翼云盘
      ©2026 天翼云科技有限公司版权所有 增值电信业务经营许可证A2.B1.B2-20090001
      公司地址:北京市东城区青龙胡同甲1号、3号2幢2层205-32室
      • 用户协议
      • 隐私政策
      • 个人信息保护
      • 法律声明
      备案 京公网安备11010802043424号 京ICP备 2021034386号