Re: Schema dump

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sonam Sharma <sonams1209(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Schema dump
Date: 2020-01-02 13:47:34
Message-ID: 11647.1577972854@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sonam Sharma <sonams1209(at)gmail(dot)com> writes:
> I took a schema dump using : pg_dump -n schema dbname .
> When I restored this , it doesn't contain the constraints and indexes. Can
> someone please help how to take a dump including all

Hmph ... works for me. Where by "works", I mean "the dump contains
constraints and indexes belonging to tables in the specified schema,
and not any others". Maybe you could provide a little more detail?

(One thing I notice is that the dump doesn't contain a "CREATE
SCHEMA schema" command, so you have to do that manually before
you restore. I guess this fits with the definition of the switch
as selecting objects *in* the named schema, but it's still a
possible gotcha.)

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-01-02 15:59:01 Re: Schema dump
Previous Message Sonam Sharma 2020-01-02 07:15:10 Schema dump