public inbox for [email protected]
help / color / mirror / Atom feedFrom: Nico Williams <[email protected]>
To: Abhishek Hatgine <[email protected]>
Cc: [email protected]
Subject: Re: Feature Proposal: Column-Level DELETE Operation in SQL
Date: Wed, 23 Apr 2025 14:05:31 -0500
Message-ID: <aAk5+zyZ9ztVOi7F@ubby> (raw)
In-Reply-To: <CAD2voTQMUmNCKBok-_HvYLqFNECRWNkvqPruq0NcsFgd6g-Odw@mail.gmail.com>
References: <CAD2voTQMUmNCKBok-_HvYLqFNECRWNkvqPruq0NcsFgd6g-Odw@mail.gmail.com>
On Mon, Apr 21, 2025 at 10:23:30PM +0530, Abhishek Hatgine wrote:
> These would act as a shortcut or expressive alias for setting one or more
> column values to NULL.
NULL values are not quite no-values, and setting some column of some row
to NULL is not quite the same as deleting the column from the row.
Even if the database's row encoding is such that a "null value" is not
written there will be bits that indicate that the column's value is
null.
Now in an entity-attribute-value (EAV) sort of schema setting a column
to NULL could be made to be the same as deleting that one row. But PG
does not currently map tables to EAV stores, though I suppose it could
eventually have table types that do just that, but that doesn't mean PG
would need a new statement type.
Even an RDBMS that only used an EAV metaschema internally would not need
a new statement type. Setting a column value to NULL is just not
"deleting a colun value".
Having two ways to do this doesn't seem necessary at all.
Moreover, with UPDATE one can set some columns to NULL values and others
to non-NULL values in the same statement, whereas one could not do that
with the new statement type you propose.
[At this point this is just piling on, for which my apologies, but I
thought the EAV thing might be worth noting.]
Nico
--
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]
Subject: Re: Feature Proposal: Column-Level DELETE Operation in SQL
In-Reply-To: <aAk5+zyZ9ztVOi7F@ubby>
* 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