Re: pg_dump and restore without indexes

From: Erik Wienhold <ewie(at)ewie(dot)name>
To: Teja Jakkidi <teja(dot)jakkidi05(at)gmail(dot)com>
Cc: pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_dump and restore without indexes
Date: 2024-06-04 17:56:13
Message-ID: dcd0950f-facc-4646-9442-0feb8f92b525@ewie.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On 2024-06-04 19:42 +0200, Teja Jakkidi wrote:
> I am trying to look for an option that can be added in pg_dump command
> to ignore all the indexes when creating the schema dump with data. Is
> there any such option that can be used in pg_dump? Or in pg_restore?

You can get the table of contents with pg_restore --list and remove or
comment out the INDEX entries in that file. Then feed the TOC back into
pg_restore with --use-list. The implicit indexes for primary key and
unique constraints will still be created, though.

--
Erik

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Teja Jakkidi 2024-06-04 17:58:24 Re: pg_dump and restore without indexes
Previous Message Teja Jakkidi 2024-06-04 17:42:17 pg_dump and restore without indexes