Skip to content
METRIC OAK

New: the 3-week Data Platform Assessment: fixed fee, priced roadmap. See what's included →

Migration

Greenplum to Snowflake migration: a practical guide

How to migrate a Greenplum warehouse to Snowflake: PostgreSQL-dialect SQL conversion, DISTINCT ON and arrays, PL/pgSQL to Snowflake Scripting, replacing DISTRIBUTED BY and gpfdist, MADlib to Snowpark, and reconciliation.

Hemant Walchale

Hemant Walchale
· 2 min read

Greenplum users are re-evaluating after changes to the product’s licensing and open-source status, and many choose a managed warehouse so they no longer run an MPP cluster themselves. Snowflake is a natural fit for SQL-heavy Greenplum estates, and its support for several PostgreSQL conventions makes conversion smoother.

This is the approach we recommend.

1. Inventory

List schemas, tables (heap, append-optimized, column-oriented), views, PL/pgSQL functions, external tables, gpload and gpfdist jobs, MADlib usage, schedules and consumers. Query logs and pg_stat views show what is used; archive the rest.

2. Map Greenplum to Snowflake

Greenplum On Snowflake
Tables (heap, AO, AOCO) Snowflake tables
DISTRIBUTED BY, DISTRIBUTED RANDOMLY Removed
Partitioned tables Automatic micro-partition pruning; optional clustering keys
VACUUM, ANALYZE Not needed
:: casts Supported
DISTINCT ON QUALIFY ROW_NUMBER() OVER (...) = 1
Arrays, json and jsonb operators ARRAY, OBJECT, VARIANT and their functions
Serial columns, sequences Sequences or IDENTITY
PL/pgSQL functions Snowflake Scripting procedures, SQL UDFs
gpfdist, gpload, external tables Stages with COPY INTO, Snowpipe, external tables
MADlib Snowpark Python with scikit-learn and similar libraries
Roles and grants Role-based access control, masking and row access policies

3. Convert and test

Most queries convert with small changes. Test regular expression functions, date and interval arithmetic, string concatenation with NULL and implicit casts. Conversion tools can handle much of the DDL and SQL.

4. Move data and reconcile

Export tables in parallel to cloud storage (for example via writable external tables), load them with COPY INTO, and keep them in sync during the parallel run. Compare every table by domain before cutting over.

5. Retire the cluster

Stop each domain’s Greenplum jobs on cutover day and decommission hosts as the cluster empties.

The short version

Archive what’s unused, drop distribution and storage options, convert PostgreSQL-dialect SQL (DISTINCT ON, arrays, JSON) and PL/pgSQL, move MADlib to Snowpark, replace gpfdist with stages and COPY INTO, reconcile and retire the cluster by domain.

Compare with Greenplum to Databricks, or browse all migration guides.

Not sure where your own platform stands? Take the free 3-minute data platform scorecard, or see how we work on Snowflake. Unfamiliar terms are explained in the data engineering glossary.

Frequently asked questions

Does Snowflake support PostgreSQL syntax?

Partly. Snowflake supports many PostgreSQL-style constructs, including the :: cast syntax, window functions and common string functions. Others need rewriting, such as DISTINCT ON (use QUALIFY with ROW_NUMBER), PostgreSQL arrays and JSON operators (use ARRAY, OBJECT and VARIANT functions), and PL/pgSQL functions.

What replaces DISTRIBUTED BY and append-optimized tables?

Nothing is needed. Snowflake stores all tables in compressed micro-partitions and distributes work automatically. Remove distribution clauses and storage options, and add clustering keys only for very large tables where measurements show they help.

What happens to MADlib models?

They are rebuilt in Python with Snowpark (using libraries such as scikit-learn inside Snowflake) and validated against the MADlib results. Simple statistical summaries often become plain SQL.

Have 30 minutes? Get a senior architect’s view of your data platform.

No sales deck. You talk to the engineer who would lead the work.

Book an architecture review