Re: Add CREATE SCHEMA ... LIKE support - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Add CREATE SCHEMA ... LIKE support
Date
Msg-id CAKFQuwYqck00fRp_xr6TVjBkQKbcJwWcQ6kTH+jipC0EzsPSkQ@mail.gmail.com
Whole thread
In response to Re: Add CREATE SCHEMA ... LIKE support  ("Matheus Alcantara" <matheusssilv97@gmail.com>)
Responses Re: Add CREATE SCHEMA ... LIKE support
List pgsql-hackers
On Wednesday, February 11, 2026, Matheus Alcantara <matheusssilv97@gmail.com> wrote:

I also want to mention that I don't think that we would be able to
properly re-created 100% all objects from the source schema into the new
schema. Some objects will be hard to copy and can still generate bougy
objects like functions for example as David mention on [1] (we can
support some kind of functions but some others will be hard).

Another issue is to handle complex relations like the following:
    - Function A returns a boolean type
    - Custom DOMAIN type call function A on CHECK constraint
    - Function B return/use a type of custom DOMAIN

What we should create first? It can have functions that depends on
domains, so domains should be created first, but it can also have
domains that depends on functions, so functions would need to be created
first. This would be trick to fix.

This is a solved problem in pg_dump, no?  It understands and follows the dependency graph.  Even allows schema-only dumps.

David J.

pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: IPC::Run::time[r|out] vs our TAP tests
Next
From: Nathan Bossart
Date:
Subject: Re: pg_upgrade: transfer pg_largeobject_metadata's files when possible