sql - 为什么我在 Redshift for select insert into 中收到此错误?
问题描述
我几乎一字不差地从另一个用户的代码中复制了另一个数据库系统(SQL Server 或 Oracle),我需要在 Redshift 中使用。
我创建了一个表:
create table #Tablelist(
tableid int identity(1,1)
,table_name varchar(50) not null
,primary key (table_name)
);
但是当我运行这个时:
insert into #Tablelist(table_name)
select distinct tablename
from pg_table_def
where tablename like '%some_pattern%';
红移 说:
Invalid operation: Specified types or functions (one per INFO message) not supported on Redshift tables.;
这部分工作正常:
select distinct tablename
from pg_table_def
where tablename like '%some_pattern%';
解决方案
和约束在Redshiftidentity
中不起作用。尝试在没有约束的情况下重新创建表,然后尝试插入数据。not null
primary key
推荐阅读
- angular - SOAP api POST 调用在 Ionic(5)/angular 中不起作用
- node.js - 同时使用“Where”和“Include”语句提取数据
- oracle - 插入 databasechangelog_export 时,Liquibase genschema 因唯一约束而失败
- c# - C# 在没有 Console.Readkey() 命令的情况下执行 Main() 方法
- html - CSS @media 做奇怪的事情
- python - itertuple循环发生错误时如何执行动作
- java - 为什么 setOnClickListener 会使我的应用程序崩溃?
- python - 根据其他列的付款数据返回活动或非活动
- react-native - React.createElement:类型无效 - 需要一个字符串(对于内置组件)或一个类/函数(对于复合组件)但得到了对象
- xml - 在 xml 操作中将函数作为参数传递