Re: [Feature Request] Schema Aliases and Versioned Schemas

From: AbdelAziz Sharaf <mickelpower75(at)gmail(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [Feature Request] Schema Aliases and Versioned Schemas
Date: 2024-12-17 04:30:51
Message-ID: CAObAeFhRCLuo-=HT=MiS2kSsfafmEav5DwK+OAnqZMG5qeGL8Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)bapat(dot)oss(at)gmail(dot)com>
wrote:

> On Wed, Nov 27, 2024 at 8:45 PM AbdelAziz Sharaf
> <mickelpower75(at)gmail(dot)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
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kirill Reshke 2024-12-17 04:31:46 Re: on_error table, saving error info to a table
Previous Message Tom Lane 2024-12-17 04:29:01 Re: Regression tests fail on OpenBSD due to low semmns value