• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
导航菜单
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx
您的位置:首页 > 服务器 >云计算 > redshift的约束策略,redshift约束策略

redshift的约束策略,redshift约束策略

作者:网友 字体:[增加 减小] 来源:互联网

本文主要包含redshift,redshift渲染器,redshift教程,redshift破解,redshift官网等服务器相关知识,网友希望可以进行参考

redshift的约束策略,redshift约束策略



官方文档:http://docs.aws.amazon.com/redshift/latest/dg/t_Defining_constraints.html
Redshift并不提供唯一性、主外键约束,但是提供非空约束
如果在建表之前需要使用约束的效果,需要确保数据本身的合法性。
同样参考的见Create语法 http://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_TABLE_NEW.html
UNIQUE

Keyword that specifies that the column can contain only unique values. The behavior of the unique table constraint is the same as that for column constraints, with the additional capability to span multiple columns. To define a unique table constraint, use the UNIQUE ( column_name [, ... ] ) syntax.


Important Unique constraints are informational and are not enforced by the system.
PRIMARY KEY

Keyword that specifies that the column is the primary key for the table. Only one column can be defined as the primary key by using a column definition. To define a table constraint with a multiple-column primary key, use the PRIMARY KEY ( column_name [, ... ] ) syntax.

Identifying a column as the primary key provides metadata about the design of the schema. A primary key implies that other tables can rely on this set of columns as a unique identifier for rows. One primary key can be specified for a table, whether as a column constraint or a table constraint. The primary key constraint should name a set of columns that is different from other sets of columns named by any unique constraint defined for the same table.

Important


Primary key constraints are informational only. They are not enforced by the system, but they are used by the planner.
References reftable [ ( refcolumn ) ]

Clause that specifies a foreign key constraint, which implies that the column must contain only values that match values in the referenced column of some row of the referenced table. The referenced columns should be the columns of a unique or primary key constraint in the referenced table.

Important


Foreign key constraints are informational only. They are not enforced by the system, but they are used by the planner.
测试: create table temp.ldc_cons_test( id int ,name varchar(20) ,PRIMARY key (id) ,UNIQUE (id) );
INSERT INTO temp.ldc_cons_test SELECT 1,'A' UNION ALL SELECT 1,'A' UNION ALL SELECT 1,'A'
SELECT * FROM temp.ldc_cons_test
1 A 1 A 1 A

版权声明:本文为博主原创文章,未经博主允许不得转载。

分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • redshift的约束策略,redshift约束策略

相关文章

  • MapReduce 按照Value值进行排序输出,mapreducevalue
  • springmvc No mapping found for HTTP request with URI in Dispatc,springmvcdispatc
  • centos源码编译docker,centos源码docker
  • Scala 有几种其它的循环结构,scala几种循环结构
  • Bulk Load-HBase数据导入最佳实践,load-hbase最佳实践
  • Name node is in safe mode.错误处理方式 hadoop,nodehadoop
  • 《转》OpenStack Live Migration,《转》openstack
  • 一步一步教你搭建基于docker的MongoDB复制集群环境,dockermongodb
  • Greenplum数据库扩容实务(上)-准备工作,greenplum实务
  • 从Zoho CRM推出本地行业解决方案看洋品牌的落地,zohocrm

文章分类

  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx

最近更新的内容

    • 通过 JMX 获取Hadoop/HBase监控数据,jmxhadoop
    • Scala函数声明与定义,Scala函数声明定义
    • http content length,contentlength
    • apache hadoop-2.6.0-CDH5.4.1 安装笔记,hadoop2.6.0安装
    • 观点 | 为什么说云主机比物理机故障率更低?,云主机
    • 给大数据文件的每一行产生唯一的id,数据一行id
    • Hive学习笔记(二),hive学习笔记
    • 解决sqoop导入关系库更新联合主键的问题,sqoop主键
    • 在linux下制作libxxx.so 动态库,linuxlibxxx.so
    • spark core源码分析7 Executor的运行,sparkexecutor

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有