Re: Restoring only a subset of schemas

2025-03-19 Thread Tom Lane
Sylvain Cuaz writes: > Further, I don't see how it's an edge-case, at the core I just want to > restore some but not all the > schemas. This is possible for pg_dump, see my response to Adrian Klaver. You have a very good point that it's annoying that pg_restore's --schema switch doesn't act lik

Re: Restoring only a subset of schemas

2025-03-19 Thread Sylvain Cuaz
Le 17/03/2025 à 16:29, Tom Lane a écrit : Sylvain Cuaz writes:     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 th

Re: Restoring only a subset of schemas

2025-03-19 Thread Sylvain Cuaz
Le 17/03/2025 à 16:21, Adrian Klaver a écrit : 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. T

Re: Restoring only a subset of schemas

2025-03-17 Thread Tom Lane
Sylvain Cuaz writes: >     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. > - if I could

Re: Restoring only a subset of schemas

2025-03-17 Thread Adrian Klaver
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 "