public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Francisco Olarte <[email protected]>
Cc: Abhishek Hatgine <[email protected]>
Cc: [email protected]
Subject: Re: Feature Proposal: Column-Level DELETE Operation in SQL
Date: Wed, 23 Apr 2025 12:39:03 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+bJJbxTXhUD2MjQgzJnAL-md1zRjmD7USvNXB90=W9_41NJMA@mail.gmail.com>
References: <CAD2voTQMUmNCKBok-_HvYLqFNECRWNkvqPruq0NcsFgd6g-Odw@mail.gmail.com>
<CA+bJJbxTXhUD2MjQgzJnAL-md1zRjmD7USvNXB90=W9_41NJMA@mail.gmail.com>
Francisco Olarte <[email protected]> writes:
> On Tue, 22 Apr 2025 at 14:09, Abhishek Hatgine
> <[email protected]> wrote:
>> However, there’s no specific, expressive way to delete the value of a column directly. The typical workaround is to use:
>> UPDATE Customers SET Address = NULL WHERE CustomerID = 103;
>> While this works fine, it doesn't semantically express that the developer intends to remove the value — not just update it.
> But there is not a concept of removed value in relational.
Yeah, that. The entire foundation of SQL, and relational databases in
general, is that a table is an array with rows and columns, and there
is something in every cell of that array --- maybe only a NULL value,
but something. You can't expect to change that without pretty much
earth-shattering consequences. As an example, are you suggesting
that it should be an error to try to fetch that specific column, but
only from that row? There's not a SQL application on the planet that
wouldn't be broken by such behavior.
I grant that the notion of "no, it's not there" makes sense in some
NoSQL applications, and that's fine. But there are reasons why NoSQL
is not SQL, and this is one.
You can already approximate this sort of behavior in Postgres by
storing the less-structured aspects of your data in a JSON or XML
column. I'd suggest pursuing that approach rather than trying
to get us to mangle fundamental SQL semantics beyond recognition.
regards, tom lane
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Feature Proposal: Column-Level DELETE Operation in SQL
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox