Convert a Snowflake schema to PostgreSQL
Paste the CREATE TABLE statements from Snowflake and ERD Designer draws them as a diagram. Change the diagram's target database to PostgreSQL and every column's datatype is converted. You review each change before it is applied, then generate the PostgreSQL script.
What changes in the sample
Converted to PostgreSQL 17, 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 | Snowflake | PostgreSQL | Note |
|---|---|---|---|
CUSTOMERS.CUSTOMER_ID | NUMBER(38,0) identity | BIGSERIAL | |
CUSTOMERS.NOTES | VARCHAR | TEXT | |
CUSTOMERS.CREATED_AT | TIMESTAMP_TZ | TIMESTAMPTZ(6) | default: CURRENT_TIMESTAMP() → CURRENT_TIMESTAMP |
ORDERS.ORDER_ID | NUMBER(38,0) identity | BIGSERIAL | |
ORDERS.CUSTOMER_ID | NUMBER(38,0) | BIGINT | |
ORDERS.TOTAL | NUMBER(12,2) | NUMERIC(12,2) | |
ORDERS.PLACED_AT | TIMESTAMP_NTZ(3) | TIMESTAMP(3) | |
ORDERS.RECEIPT_PDF | BINARY | BYTEA |
What it tells you
Where a conversion loses something, ERD Designer says so rather than picking for you. These are the messages for the sample:
- CUSTOMERS.CREATED_AT: PostgreSQL keeps at most 6 fractional-second digits — "(9)" became (6).
The PostgreSQL script
This is what ERD Designer generates for the sample, for PostgreSQL 17. Our test suite applies this conversion to a real PostgreSQL server and then reads the database back to confirm it matches the diagram exactly.
-- Create table CUSTOMERS
CREATE TABLE "CUSTOMERS" (
"CUSTOMER_ID" BIGSERIAL NOT NULL,
"EMAIL" VARCHAR(255) NOT NULL,
"FULL_NAME" VARCHAR(120) NOT NULL,
"NOTES" TEXT,
"IS_ACTIVE" BOOLEAN NOT NULL DEFAULT TRUE,
"CREATED_AT" TIMESTAMP(6) WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "CUSTOMERS_PK" PRIMARY KEY ("CUSTOMER_ID")
);
-- Create table ORDERS
CREATE TABLE "ORDERS" (
"ORDER_ID" BIGSERIAL NOT NULL,
"CUSTOMER_ID" BIGINT NOT NULL,
"PUBLIC_ID" VARCHAR(36) NOT NULL,
"STATUS" VARCHAR(10) NOT NULL DEFAULT 'new',
"TOTAL" NUMERIC(12,2) NOT NULL,
"PLACED_AT" TIMESTAMP(3) NOT NULL,
"RECEIPT_PDF" BYTEA,
CONSTRAINT "ORDERS_PK" PRIMARY KEY ("ORDER_ID")
);
-- Add unique constraint on CUSTOMERS (EMAIL)
ALTER TABLE "CUSTOMERS" ADD CONSTRAINT "CUSTOMERS_EMAIL_UQ" 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 Snowflake 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 PostgreSQL under Target Database / Version, and press Apply Changes.
- If PostgreSQL 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 PostgreSQL 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
- Snowflake to Oracle
- Snowflake to SQL Server
- Snowflake to MySQL
- Snowflake to MariaDB
- Snowflake to SQLite
- Snowflake to Amazon Redshift
- Snowflake to Google BigQuery
- Oracle to PostgreSQL
- SQL Server to PostgreSQL
- MySQL to PostgreSQL
- MariaDB to PostgreSQL
- SQLite to PostgreSQL
- Amazon Redshift to PostgreSQL
- Google BigQuery to PostgreSQL
Questions? Write to support@erddesigner.com. · ERD Designer · Terms · Privacy