Hi Matheus

On 06/02/2026 15:22, Matheus Alcantara wrote:
> I'd like to propose the introduction of the LIKE syntax on CREATE SCHEMA
> command with the following syntax:
>   CREATE SCHEMA <name> LIKE <source_schema> [like_options...]
> 
> Where like_options is:
>   { INCLUDING | EXCLUDING } { TABLE | INDEX | ... | ALL }
> 
> The idea of LIKE syntax is to create a new schema with all objects that
> exist on source schema like tables, indexes, sequences, functions,
> views, etc.


I generally like the idea.

One quick note:

I'm just wondering if using a similar syntax as IMPORT FOREIGN SCHEMA
would be better than creating a new one


IMPORT FOREIGN SCHEMA remote_schema
    [ { LIMIT TO | EXCEPT } ( table_name [, ...] ) ]
    FROM SERVER server_name
    INTO local_schema
    [ OPTIONS ( option 'value' [, ... ] ) ]


So EXCEPT instead of EXCLUDING and LIMIT TO instead of INCLUDING. Of
course, assuming the proposed syntax isn't already defined in the SQL
standard.

Best, Jim


Reply via email to