Re: Feature Proposal: Column-Level DELETE Operation in SQL

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Abhishek Hatgine <hatgineabhishek99(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Feature Proposal: Column-Level DELETE Operation in SQL
Date: 2025-04-23 16:47:50
Message-ID: A4759080-C019-4017-A2EB-2A032D5008A8@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Apr 21, 2025, at 09:53, Abhishek Hatgine <hatgineabhishek99(at)gmail(dot)com> 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;

I'm not sure I agree that's unexpressive. When you consider the relational model, it's not clear to me what "deleting the value of a column" means. It could be:

1. Removing the current value, which begs the question of "replacing it with what?"
2. Dropping the column, for which we already have ALTER TABLE ... DROP COLUMN.

Can you give a bit more detail about what the state of the table is when you have "deleted the value of a column directly"?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2025-04-23 18:28:16 Re: Another documentation issue
Previous Message Tom Lane 2025-04-23 16:39:03 Re: Feature Proposal: Column-Level DELETE Operation in SQL