public inbox for [email protected]
help / color / mirror / Atom feedFrom: Adrian Klaver <[email protected]>
To: Sylvain Cuaz <[email protected]>
To: [email protected]
Subject: Re: Restoring only a subset of schemas
Date: Mon, 17 Mar 2025 08:21:11 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
On 3/17/25 07:57, Sylvain Cuaz wrote:
> Hi all,
>
> I have a DB with one schema named "Common" holding data referenced
> by other schemas. All other schemas have the same structure (tables and
> fields) and are named "cXXX" where XXX is just an int. Thus the only
> cross-schema foreign keys are in "cXXX" pointing to "Common", and each
> "cXXX" is completely independent of other "cXXX" schemas.
> Now if I want to restore from a full dump of this DB, but with only
> one "cXXX" and the "Common" schema :
> - if I pass --create --schema=Common, then the CREATE SCHEMA is missing,
> i.e. it only emits data inside "Common" and the restore fails.
I am not seeing that.
For:
pg_dump -d test -U postgres -s --create --schema=other_sch --schema=public
In the output I get:
[...]
CREATE SCHEMA other_sch;
ALTER SCHEMA other_sch OWNER TO postgres;
--
-- Name: public; Type: SCHEMA; Schema: -; Owner: pg_database_owner
--
CREATE SCHEMA public;
ALTER SCHEMA public OWNER TO pg_database_owner;
[...]
What is the complete command you are using for the pg_dump?
What Postgres version(s) are you using?
>
> Cheers,
>
> Sylvain
>
>
>
--
Adrian Klaver
[email protected]
view thread (6+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Restoring only a subset of schemas
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox