Re: Schema variables - new implementation for Postgres 15 - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Schema variables - new implementation for Postgres 15
Date
Msg-id 7d117cb6-c4e5-4e87-9bb2-69aa92f8a03a@eisentraut.org
Whole thread Raw
In response to Re: Schema variables - new implementation for Postgres 15  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: Schema variables - new implementation for Postgres 15
Re: Schema variables - new implementation for Postgres 15
Re: Schema variables - new implementation for Postgres 15
Re: Schema variables - new implementation for Postgres 15
List pgsql-hackers
On 18.05.24 13:29, Alvaro Herrera wrote:
> I want to note that when we discussed this patch series at the dev
> meeting in FOSDEM, a sort-of conclusion was reached that we didn't want
> schema variables at all because of the fact that creating a variable
> would potentially change the meaning of queries by shadowing table
> columns.  But this turns out to be incorrect: it's_variables_  that are
> shadowed by table columns, not the other way around.

But that's still bad, because seemingly unrelated schema changes can 
make variables appear and disappear.  For example, if you have

SELECT a, b FROM table1

and then you drop column b, maybe the above query continues to work 
because there is also a variable b.  Or maybe it now does different 
things because b is of a different type.  This all has the potential to 
be very confusing.




pgsql-hackers by date:

Previous
From: torikoshia
Date:
Subject: Re: First draft of PG 17 release notes
Next
From: Nikita Malakhov
Date:
Subject: Re: Shared detoast Datum proposal