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
98
votes
11 answers

Alter column data type in Amazon Redshift

How to alter column data type in Amazon Redshift database? I am not able to alter the column data type in Redshift; is there any way to modify the data type in Amazon Redshift?
user1485267
  • 1,295
  • 2
  • 10
  • 19
88
votes
10 answers

Show tables, describe tables equivalent in redshift

I'm new to aws, can anyone tell me what are redshifts' equivalents to mysql commands? show tables -- redshift command describe table_name -- redshift command
sk2
  • 1,171
  • 1
  • 10
  • 28
76
votes
10 answers

postgresql - view schema privileges

Is there a query I can run to show currently assigned privileges on a particular schema? i.e. privileges that were assigned like so: GRANT USAGE ON SCHEMA dbo TO MyUser I have tried SELECT * FROM information_schema.usage_privileges; but this only…
mwrichardson
  • 1,148
  • 1
  • 8
  • 12
58
votes
8 answers

how to find size of database, schema, table in redshift

Team, my redshift version is: PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3), Redshift 1.0.735 how to find out database size, tablespace, schema size & table size ? but below are not working…
user3258784
  • 1,987
  • 6
  • 24
  • 28
58
votes
4 answers

redshift drop or truncate table very very slow

When drop or truncate a not too big table(4M rows) in my redshift database, it take very very long(hours) to complete. Does anybody experience the same issue? Thanks
user2916054
  • 601
  • 1
  • 6
  • 3
57
votes
7 answers

Declare a variable in RedShift

SQL Server has the ability to declare a variable, then call that variable in a query like so: DECLARE @StartDate date; SET @StartDate = '2015-01-01'; SELECT * FROM Orders WHERE OrderDate >= @StartDate; Does this functionality work in Amazon's…
mikebmassey
  • 8,354
  • 26
  • 70
  • 95
57
votes
4 answers

In Redshift/Postgres, how to count rows that meet a condition?

I'm trying to write a query that count only the rows that meet a condition. For example, in MySQL I would write it like this: SELECT COUNT(IF(grade < 70), 1, NULL) FROM grades ORDER BY id DESC; However, when I attempt to do that on…
ILikeTacos
  • 17,464
  • 20
  • 58
  • 88
52
votes
6 answers

How to get the last day of month in postgres?

How to find the last day os the month in postgres? I have a date columns stored as numeric(18) in the format(YYYYMMDD) I am trying it to make it date using to_date("act_dt",'YYYYMMDD') AS "act date" then find the last day of this date: like…
Hare Rama Hare Krishna
  • 1,025
  • 5
  • 14
  • 19
49
votes
6 answers

How to convert epoch to datetime redshift?

I work in dbeaver. I have a table x. TABLE x has a column "timestamp" 1464800406459 1464800400452 1464800414056 1464800422854 1464800411797 The result I want: Wed, 01 Jun 2016 17:00:06.459 GMT Wed, 01 Jun 2016 17:00:00.452 GMT Wed, 01 Jun 2016…
khusnanadia
  • 813
  • 2
  • 7
  • 20
48
votes
6 answers

Amazon redshift: bulk insert vs COPYing from s3

I have a redshift cluster that I use for some analytics application. I have incoming data that I would like to add to a clicks table. Let's say I have ~10 new 'clicks' that I want to store each second. If possible, I would like my data to be…
Benjamin Crouzier
  • 40,265
  • 44
  • 171
  • 236
46
votes
9 answers

Redshift COPY command delimiter not found

I'm trying to load some text files to Redshift. They are tab delimited, except for after the final row value. That's causing a delimiter not found error. I only see a way to set the field delimiter in the COPY statement, not a way to set a row…
Erik Darling
  • 606
  • 1
  • 12
  • 21
43
votes
7 answers

How do I view grants on Redshift

I'd like to view grants on redshifts. I found this view for postgres: CREATE OR REPLACE VIEW view_all_grants AS SELECT use.usename as subject, nsp.nspname as namespace, c.relname as item, c.relkind as type, use2.usename as owner, …
sw1nn
  • 7,278
  • 1
  • 26
  • 36
41
votes
6 answers

Local development and staging with Amazon Redshift

I like to set up tools and services with production, staging, and local development. I'd like to use Amazon Redshift, and starting at $180 a month seems pretty reasonable for a columnar store database, but do I actually have to think about it as…
freyley
  • 4,145
  • 3
  • 20
  • 25
39
votes
3 answers

Column is of type timestamp without time zone but expression is of type character

I'm trying to insert records on my trying to implement an SCD2 on Redshift but get an error. The target table's DDL is CREATE TABLE ditemp.ts_scd2_test ( id INT ,md5 CHAR(32) ,record_id BIGINT IDENTITY ,from_timestamp TIMESTAMP …
user2518751
  • 685
  • 1
  • 10
  • 20
39
votes
10 answers

Redshift. Convert comma delimited values into rows

I am wondering how to convert comma-delimited values into rows in Redshift. I am afraid that my own solution isn't optimal. Please advise. I have table with one of the columns with coma-separated values. For example: I…
Yuri Levinsky
  • 1,515
  • 2
  • 13
  • 26
1
2 3
99 100