Trouble with pg_restore

Hello,

I'm trying to migrate our Metabase from Heroku to AWS RDS.

When I used pg_restore, I encounter an error and I'm not sure what to do about it:

pg_restore: creating TABLE "public.core_user"
pg_restore: from TOC entry 208; 1259 16429 TABLE core_user u76n00nsp42j0i
pg_restore: error: could not execute query: ERROR:  type "public.citext" does not exist
LINE 3:     "email" "public"."citext" NOT NULL,
                    ^
Command was: CREATE TABLE "public"."core_user" (
    "id" integer NOT NULL,
    "email" "public"."citext" NOT NULL,
    "first_name" character varying(254) NOT NULL,
    "last_name" character varying(254) NOT NULL,
    "password" character varying(254) NOT NULL,
    "password_salt" character varying(254) DEFAULT 'default'::character varying NOT NULL,
    "date_joined" timestamp with time zone NOT NULL,
    "last_login" timestamp with time zone,
    "is_superuser" boolean DEFAULT false NOT NULL,
    "is_active" boolean DEFAULT true NOT NULL,
    "reset_token" character varying(254),
    "reset_triggered" bigint,
    "is_qbnewb" boolean DEFAULT true NOT NULL,
    "google_auth" boolean DEFAULT false NOT NULL,
    "ldap_auth" boolean DEFAULT false NOT NULL,
    "login_attributes" "text",
    "updated_at" timestamp without time zone,
    "sso_source" character varying(254),
    "locale" character varying(5)
);

As a result, I see a lot of errors in pg_restore's output about not being able to find public.core_user, and in metabase's application logs if I try to use this database.

The steps I've used to reproduce this issue are:

heroku pg:backups:capture --app app-name
heroku pg:backups:download --app app-name --output metabase.dump
createdb -U metabase -W -h rds-host --encoding=UTF8 -e metabase
pg_restore --verbose --clean --no-acl --no-owner -h rds-host -U metabase -d metabase ./metabase.dump

Is there some mistake I'm making here?

What are the versions of the source and destination postgres? it seems that there is no CITEXT type in the table that you're trying to restore to

For anyone else running into this issue, I needed to install the citext extension:

CREATE EXTENSION IF NOT EXISTS citext WITH SCHEMA public;