Amazon RedShift: Unique Column not being honored

Question:

I use the following query to create my table.

Then I insert about 500 urls, twice. I am expecting that the second time I had the URLs that no new entries show up in my table, but instead my count value doubles for:

What I want is that when I try and add a url that is already in my table, it is skipped.
Have I declared something in my table deceleration incorrect?

I am using RedShift from AWS.

Sample

Output of \d seed

urlenrich=# \d seed

Answer:

Figured out the problem

Amazon RedShift does not enforce constraints…

As explained here
http://docs.aws.amazon.com/redshift/latest/dg/t_Defining_constraints.html

They said they may get around to changing it at some point.

NEW 11/21/2013
RDS has added support for PostGres, if you need unique and such an postgres rds instance is now the best way to go.

Leave a Reply