← Every conversion

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.

You sign up free and land on your diagram. Your script is held for 15 minutes and deleted from our server the moment you open it.

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.

ColumnSnowflakePostgreSQLNote
CUSTOMERS.CUSTOMER_IDNUMBER(38,0) identityBIGSERIAL
CUSTOMERS.NOTESVARCHARTEXT
CUSTOMERS.CREATED_ATTIMESTAMP_TZTIMESTAMPTZ(6)default: CURRENT_TIMESTAMP() → CURRENT_TIMESTAMP
ORDERS.ORDER_IDNUMBER(38,0) identityBIGSERIAL
ORDERS.CUSTOMER_IDNUMBER(38,0)BIGINT
ORDERS.TOTALNUMBER(12,2)NUMERIC(12,2)
ORDERS.PLACED_ATTIMESTAMP_NTZ(3)TIMESTAMP(3)
ORDERS.RECEIPT_PDFBINARYBYTEA

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:

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

  1. Paste your Snowflake script above and press Open in ERD Designer. The diagram opens laid out and ready to edit.
  2. Click the diagram's name in the toolbar to open its properties, choose PostgreSQL under Target Database / Version, and press Apply Changes.
  3. If PostgreSQL offers more than one way to store a kind of column, choose one and press Continue.
  4. Read the list of retyped columns and any warnings, then press Apply Conversion. Save the diagram to keep it.
  5. 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

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

Questions? Write to support@erddesigner.com. · ERD Designer · Terms · Privacy