Re: [Feature Request] Schema Aliases and Versioned Schemas - Mailing list pgsql-hackers

From AbdelAziz Sharaf
Subject Re: [Feature Request] Schema Aliases and Versioned Schemas
Date
Msg-id CAObAeFhRCLuo-=HT=MiS2kSsfafmEav5DwK+OAnqZMG5qeGL8Q@mail.gmail.com
Whole thread Raw
In response to Re: [Feature Request] Schema Aliases and Versioned Schemas  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
List pgsql-hackers
No
when specifying search_path, we build another schema, where each duplicate data must be inside
what I suggested is to have versions/aliases for schemas and any duplicate table/view/... could be inherited if duplicate with all data inside and when any version/alias is dropped and another version/alias has the same table it's preserved, with data inside
that's different behavior where tables attach to schema and if inherited from version/table it may create/reuse it with/without data inside
and this behavior is resource lightweight for migrations
it also could introduce shared tables between schemas

Hope this helps

> Note : sorry for repeating the msg, I realized the replay was only to Ashutouh, not the messaging list, think that's why I didn't have any replay, it may be lost

On Thu, Nov 28, 2024 at 1:10 PM Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> wrote:
On Wed, Nov 27, 2024 at 8:45 PM AbdelAziz Sharaf
<mickelpower75@gmail.com> wrote:
>
> Dear PostgreSQL Development Team,
>
> I’d like to propose a new feature for consideration: schema aliases and versions
>
> **Problem Statement:**
> For migrating old db to new one, one must use an external tool or define a dedicated migration script where all possible issues could arise
>
> **Proposed Solution:**
> there is two ways I may think about
> - versioned schemas : where every version act as a separate schema and the `latest` one or the one the program request is the one in use and each new schema could inherit a table, index, view, ... without additional data
> - aliases : where every new schema is defined and migrated separately then an alias is set for the one in use

Isn't this same as adding the required schema name in the search_path?

--
Best Wishes,
Ashutosh Bapat

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Regression tests fail on OpenBSD due to low semmns value
Next
From: Kirill Reshke
Date:
Subject: Re: on_error table, saving error info to a table