Column reset all values

From: otar shavadze <oshavadze(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Column reset all values
Date: 2020-05-13 08:13:20
Message-ID: CAG-jOyDg7TZ_x1rsL=URVc51sPxfNvi1YMWsLQmeqT1eCtVsTg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

postgres version 12
I have very simple update query, like this:

update my_table
set
col = NULL
where
col IS NOT NULL;

my_table contains few million rows, col is indexed column

Fastest way would be alter table, drop column and then add column again,
but I can't do this just because on this column depends bunch of views
and materialized views.

No much hope, but still asking, Is there some another way to just reset
column all values? ( with NULL in my case)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2020-05-13 08:35:49 Re: Column reset all values
Previous Message Amine Tengilimoglu 2020-05-13 07:34:35 Re: what is the best way to access cold data on another server?