Convert a Amazon Redshift schema to Snowflake
Paste the CREATE TABLE statements from Amazon Redshift and ERD Designer draws them as a diagram. Change the diagram's target database to Snowflake and every column's datatype is converted. You review each change before it is applied, then generate the Snowflake script.
What changes in the sample
Converted to Snowflake, these columns of the sample above change type. Everything else keeps its type; names, keys, nullability and lists of allowed values are left as they are.
| Column | Amazon Redshift | Snowflake | Note |
|---|---|---|---|
customers.created_at | TIMESTAMPTZ | TIMESTAMP_TZ | default: SYSDATE → CURRENT_TIMESTAMP |
orders.public_id | CHAR(36) | VARCHAR(36) | |
orders.total | DECIMAL(12,2) | NUMBER(12,2) | |
orders.placed_at | TIMESTAMP | TIMESTAMP_TZ |
The sample converts with nothing to warn about. A schema that loses something on the way — a time zone, a precision, a type Snowflake does not have — gets a message naming the column and what changed.
The Snowflake script
This is what ERD Designer generates for the sample, for Snowflake. Our test suite applies this conversion to a real Snowflake server and then reads the database back to confirm it matches the diagram exactly.
-- NOTE: Snowflake does not enforce PRIMARY KEY, UNIQUE or FOREIGN KEY — only NOT NULL.
-- They document the design and inform the optimiser; nothing prevents a duplicate or an orphan.
-- Names are written exactly as in the diagram, in double quotes: a lower-case name must be
-- queried in quotes ("customers"), because Snowflake reads an unquoted name as upper case.
-- Create table customers
CREATE TABLE "customers" (
"customer_id" INTEGER NOT NULL,
"email" VARCHAR(255) NOT NULL,
"full_name" VARCHAR(120) NOT NULL,
"notes" VARCHAR(65535),
"is_active" BOOLEAN NOT NULL DEFAULT TRUE,
"created_at" TIMESTAMP_TZ NOT NULL DEFAULT CURRENT_TIMESTAMP(),
CONSTRAINT "customers_PK" PRIMARY KEY ("customer_id")
);
-- Create table orders
CREATE TABLE "orders" (
"order_id" INTEGER NOT NULL,
"customer_id" INTEGER NOT NULL,
"public_id" VARCHAR(36) NOT NULL,
"status" VARCHAR(10) NOT NULL DEFAULT 'new',
"total" NUMBER(12,2) NOT NULL,
"placed_at" TIMESTAMP_TZ NOT NULL,
CONSTRAINT "orders_PK" PRIMARY KEY ("order_id")
);
-- Add unique constraint on customers (email)
ALTER TABLE "customers" ADD CONSTRAINT "customers_UQ1" UNIQUE ("email");
-- Add foreign key orders (customer_id) → customers (customer_id)
ALTER TABLE "orders" ADD CONSTRAINT "orders_FK1" FOREIGN KEY ("customer_id") REFERENCES "customers" ("customer_id");
How to convert your own schema
- Paste your Amazon Redshift script above and press Open in ERD Designer. The diagram opens laid out and ready to edit.
- Click the diagram's name in the toolbar to open its properties, choose Snowflake under Target Database / Version, and press Apply Changes.
- If Snowflake offers more than one way to store a kind of column, choose one and press Continue.
- Read the list of retyped columns and any warnings, then press Apply Conversion. Save the diagram to keep it.
- Press Generate DDL (the database icon) to copy or download the Snowflake script — or apply it to a database on your own network with the ERD Designer Agent.
What it reads, and what it does not
- It reads
CREATE TABLE,ALTER TABLE … ADD CONSTRAINTandCREATE INDEX: tables, columns, keys, foreign keys, unique constraints, check lists and indexes. Anything else in the script is skipped and listed. - It converts the schema, never the data: no rows are read, moved or changed.
- It does not convert views, stored procedures, functions, triggers or packages.
Which plan you need
Pasting a script and working with it as a diagram is free on the Basic plan, with no card. Converting a diagram to another database is part of the Pro and Advanced plans, which also generate its script and can apply it through the Agent.
Other conversions
- Amazon Redshift to PostgreSQL
- Amazon Redshift to Oracle
- Amazon Redshift to SQL Server
- Amazon Redshift to MySQL
- Amazon Redshift to MariaDB
- Amazon Redshift to SQLite
- Amazon Redshift to Google BigQuery
- PostgreSQL to Snowflake
- Oracle to Snowflake
- SQL Server to Snowflake
- MySQL to Snowflake
- MariaDB to Snowflake
- SQLite to Snowflake
- Google BigQuery to Snowflake
Questions? Write to support@erddesigner.com. · ERD Designer · Terms · Privacy