Re: Add CREATE SCHEMA ... LIKE support

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Matheus Alcantara <matheusssilv97(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Add CREATE SCHEMA ... LIKE support
Date: 2026-02-12 20:38:12
Message-ID: 202602122031.ds4a6w36uzys@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

On 2026-Feb-06, Matheus Alcantara wrote:

> I was reading the TODO wiki page and found the "Add CREATE SCHEMA ...
> LIKE that copies a schema" item and I thought that it could be a good
> idea to have this at core.

Egad. A TODO thing from way back which probably doesn't make much sense
nowadays, or at least so I think.

This whole thing seems like a giant can of worms, and I'm not sure it's
a good idea to add DDL syntax for it. I didn't read the thread in
detail, but the discussions downthread about adding weird clauses to
CREATE SCHEMA look quite worrisome.

Why not try to devise a way to reuse the DDL functions being proposed in
various nearby pgsql-hackers threads? There are a bunch of such patches
in the commitfest already; it's probably easy to have a way to generate
a list of objects in a schema, then call the DDL function corresponding
to each object type for each object, and then you're done.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2026-02-12 20:42:27 Re: Changing shared_buffers without restart
Previous Message Jacob Champion 2026-02-12 20:30:12 Re: Improve OAuth discovery logging