How to Set Up Redshift on Windows

Galaxy Glossary

How do I set up Amazon Redshift on Windows?

Install the AWS CLI, create a Redshift cluster, open network access, and connect with a PostgreSQL client from a Windows machine.

Sign up for the latest in SQL knowledge from the Galaxy Team!
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.

Description

What do I install first on Windows?

Install two tools: AWS CLI v2 for provisioning the cluster and psql (bundled with PostgreSQL) for SQL access. Use Chocolatey for one-line installs:
choco install awscli
choco install postgresql

How do I create a Redshift cluster from Windows?

Open PowerShell and run the AWS CLI command in the us-east-1 region.Replace placeholders with your values.

aws redshift create-cluster \
--cluster-identifier ecommerce-dev \
--node-type ra3.xlplus \
--number-of-nodes 2 \
--master-username masteruser \
--master-user-password "Str0ngP@ss!" \
--db-name ecommerce \
--iam-roles arn:aws:iam::123456789012:role/RedshiftRole \
--region us-east-1

How do I open network access?

In the AWS console, edit the cluster’s VPC security group. Add an inbound rule for TCP 5439 from your office IP or VPN CIDR. Avoid 0.0.0.0/0 in production.

How do I connect with psql?

Copy the cluster endpoint (e.g., ecommerce-dev.abc123.us-east-1.redshift.amazonaws.com).Then run:

psql "host=ecommerce-dev.abc123.us-east-1.redshift.amazonaws.com \
port=5439 dbname=ecommerce user=masteruser password=Str0ngP@ss!"

How do I verify the connection?

Run a quick query:

SELECT current_user, current_database(), version();

You should see your user, database, and the Redshift PostgreSQL version.

Can I load sample ecommerce data?

Yes. Use COPY to pull CSV files from S3 into tables such as Customers, Orders, Products, and OrderItems.Example:

COPY Customers
FROM 's3://my-bucket/customers.csv'
IAM_ROLE 'arn:aws:iam::123456789012:role/RedshiftRole'
CSV;

Best practices for Windows users?

  • Store credentials in %UserProfile%\.aws\credentials and enable MFA.
  • Use aws redshift modify-cluster to apply automatic snapshots.
  • Use parameter groups to enable enable_user_activity_logging for auditing.

.

Why How to Set Up Redshift on Windows is important

How to Set Up Redshift on Windows Example Usage


-- Top-selling products this month
SELECT p.name, SUM(oi.quantity) AS units_sold
FROM OrderItems oi
JOIN Products p ON p.id = oi.product_id
JOIN Orders o ON o.id = oi.order_id
WHERE date_trunc('month', o.order_date) = date_trunc('month', CURRENT_DATE)
GROUP BY p.name
ORDER BY units_sold DESC
LIMIT 10;

How to Set Up Redshift on Windows Syntax


-- Create a Redshift cluster
aws redshift create-cluster \
  --cluster-identifier <cluster_name> \
  --node-type <dc2.large | dc2.8xlarge | ra3.xlplus | ra3.4xlarge | ra3.16xlarge> \
  --number-of-nodes <integer> \
  --master-username <master_user> \
  --master-user-password <password> \
  --db-name <database_name> \
  --iam-roles <iam_role_arn> \
  [--vpc-security-group-ids <sg_id>] \
  [--port <5439>] \
  [--region <aws_region>]

-- Connect from Windows PowerShell using psql
psql "host=<endpoint> port=<5439> dbname=<database_name> user=<master_user> password=<password>"

-- Example ecommerce query once connected
SELECT c.name, o.total_amount
FROM Customers c
JOIN Orders o ON o.customer_id = c.id
WHERE o.order_date >= CURRENT_DATE - INTERVAL '30 days'
ORDER BY o.total_amount DESC;

Common Mistakes

Frequently Asked Questions (FAQs)

Is a Windows EC2 instance required?

No. All commands run locally on your Windows laptop. The cluster itself runs in AWS.

Can I use SQL Workbench/J instead of psql?

Yes. Any PostgreSQL-compatible client works. Provide the endpoint, port 5439, and your credentials.

How do I resize the cluster later?

Run aws redshift modify-cluster --cluster-identifier ecommerce-dev --number-of-nodes 4. Redshift will add nodes with minimal downtime.

Want to learn about other SQL terms?

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie
BauHealth Logo
Truvideo Logo
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.