Re: Retrieve "CREATE FOREIGN SERVER" with pg_dump ... --schema=

From: Peter Adlersburg <peter(dot)adlersburg(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Retrieve "CREATE FOREIGN SERVER" with pg_dump ... --schema=
Date: 2024-07-08 16:40:41
Message-ID: CAD1Uk1qt_HbADFdwY0ygW9rNFnFFr03h3kZ1u8CTHrCqQNrUOQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello David,

I asked for a trick and I got one - will use --exclude-schemas=*
accordingly.

And yes: I could have come to this conclusion by myself ... It's been a
long day ...

Thx a million & KR

p.

Am Mo., 8. Juli 2024 um 18:33 Uhr schrieb David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com>:

> On Mon, Jul 8, 2024 at 9:17 AM Peter Adlersburg <
> peter(dot)adlersburg(at)gmail(dot)com> wrote:
>
>>
>> What's the trick to use --schema= with pg_dump *AND* also have the
>> foreign server definition and the user mappings copied?
>> (I also included --schema=public but that changed nothing)
>>
>>
>
> Create Server makes it clear it does not exist within a schema.
>
> pg_dump has a note:
>
> "Non-schema objects such as large objects are not dumped when -n is
> specified. You can add large objects back to the dump with the
> --large-objects switch."
>
> The absence of any corresponding --server option in pg_dump to accomplish
> the same for the server non-schema object means that what you want to do is
> not presently possible.
>
> Since you are doing partial dumps anyway - dump the non-schema objects
> first (-N *) ? then dump the desired schemas? Then just perform two
> restores.
>
> David J.
>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Lucio Chiessi 2024-07-08 17:17:20 Logical Replication disconnecting and taking a while to return back.
Previous Message David G. Johnston 2024-07-08 16:32:26 Re: Retrieve "CREATE FOREIGN SERVER" with pg_dump ... --schema=