Questions tagged [amazon-redshift]

Amazon Redshift is a petabyte-scale data warehousing service using existing business intelligence tools to analyze the data. Redshift is a column-oriented MPP database based on ParAccel and ParAccel was itself based on PostgreSQL.

Amazon Redshift is a fast, fully managed, petabyte-scale data warehouse service that makes it simple and cost-effective to efficiently analyze all your data using your existing business intelligence tools. It is optimized for datasets ranging from a few hundred gigabytes to a petabyte or more. Redshift is a column-oriented database based on PostgreSQL 8.0.2

Source: Amazon Redshift

Although Redshift to some extent is based on PostgreSQL they are substantially different. Do not add the postgresql tag to questions involving Amazon Redshift

Related Tags

8534 questions
20
votes
4 answers

How to change table schema after created in Redshift?

Postgre supports this operation as below: ALTER TABLE name SET SCHEMA new_schema The operation won't work in Redshift. Is there any way to do that? I tried to update pg_class to set relnamespace(schema id) for the table, which needs superuser…
elprup
  • 1,960
  • 2
  • 18
  • 32
20
votes
4 answers

AWS Redshift JDBC insert performance

I am writing a proof-of-concept app which is intended to take live clickstream data at the rate of around 1000 messages per second and write it to Amazon Redshift. I am struggling to get anything like the performance some others claim (for example,…
dty
  • 18,795
  • 6
  • 56
  • 82
20
votes
6 answers

Amazon Redshift Keys are not enforced - how to prevent duplicate data?

Just testing out AWS Redshift, and having discovered some dupe data on an insert that I'd hoped would just fail on duplication in the key column, reading the docs reveal that primary key constraints aren't "enforced". Anyone figured out how to…
Saeven
  • 2,280
  • 1
  • 20
  • 33
19
votes
2 answers

Redshift query between date

I'm quite new to Redshift SQL. select * from myredshift_tbl where local_date between \'2016-01-01\' and \'2017-02-01\'; But got this error: [amazon][500310] invalid operation syntax error at or near "\". I believe Redshift use single…
newleaf
  • 2,257
  • 8
  • 32
  • 52
19
votes
2 answers

Amazon Redshift : drop table if exists

Does Redshift support any statement equivalent to the following? DROP TABLE IF EXISTS tablename
Attilah
  • 17,632
  • 38
  • 139
  • 202
19
votes
8 answers

How to copy csv data file to Amazon RedShift?

I'm trying to migrating some MySQL tables to Amazon Redshift, but met some problems. The steps are simple: 1. Dump the MySQL table to a csv file 2. Upload the csv file to S3 3. Copy the data file to RedShift Error occurs in step 3: The SQL command…
ciphor
  • 8,018
  • 11
  • 53
  • 70
18
votes
3 answers

How to Load Data into Amazon Redshift via Python Boto3?

In Amazon Redshift's Getting Started Guide, data is pulled from Amazon S3 and loaded into an Amazon Redshift Cluster utilizing SQLWorkbench/J. I'd like to mimic the same process of connecting to the cluster and loading sample data into the cluster…
Chris
  • 5,444
  • 16
  • 63
  • 119
18
votes
4 answers

Redshift INSERT INTO TABLE from CTE

According to the Redshift WITH Clause documentation, you can use a WITH clause with a INSERT INTO...SELECT statement. However when testing this, I am getting the below error. Is this not possible, or do I have the syntax wrong? CREATE TABLE…
fez
  • 1,726
  • 3
  • 21
  • 31
18
votes
1 answer

Handling Redshift identity columns in SQLAlchemy

I'm using the redshift-sqlalchemy package to connect SQLAlchemy to Redshift. In Redshift I have a simple "companies" table: create table if not exists companies ( id bigint identity primary key, name varchar(1024) not null ); On the…
Walter Gillett
  • 371
  • 1
  • 2
  • 9
18
votes
1 answer

How to select multiple rows filled with constants in Amazon Redshift?

I have already tried the common PostgreSQL answer, but seems like it doesn't work with Redshift: SELECT * FROM VALUES (1) AS q (col1); ERROR: 42883: function values(integer) does not exist I need this because for some reason I can't use UNION…
Inferno1892
  • 233
  • 1
  • 3
  • 11
18
votes
2 answers

Pros & cons of BigQuery vs. Amazon Redshift

Comparing Google BigQuery vs. Amazon Redshift shows that both can answer same set of requirements, differ mostly by cost plans. It seems that Redshift is more complex to configure (defining keys and optimization work) vs. Google BigQuery that…
user2339344
  • 951
  • 2
  • 12
  • 22
18
votes
4 answers

Copying data from S3 to AWS redshift using python and psycopg2

I'm having issues executing the copy command to load data from S3 to Amazon's Redshift from python. I have the following copy command: copy moves from 's3:///moves_data/2013-03-24/18/moves' credentials…
Yaniv Golan
  • 982
  • 5
  • 15
  • 28
17
votes
3 answers

redshift: count distinct customers over window partition

Redshift doesn't support DISTINCT aggregates in its window functions. AWS documentation for COUNT states this, and distinct isn't supported for any of the window functions. My use case: count customers over varying time intervals and traffic…
Merlin
  • 1,780
  • 1
  • 18
  • 20
17
votes
5 answers

How to connect Amazon Redshift to python

This is my python code and I want to connect my Amazon Redshift database to Python, but it is showing error in host. Can anyone tell me the correct syntax? Am I passing all the parameters correctly? con=psycopg2.connect("dbname = pg_table_def,…
17
votes
1 answer

How to create a dependency list for an object in Redshift?

My team has views built upon views built upon views, so often a DROP TABLE CASCADE is a recipe for disaster and a lot of trial and error. What I would like is a query that returns all dependent objects that need to be re-created in the correct order…
flybonzai
  • 3,763
  • 11
  • 38
  • 72