On Wed, Apr 23, 2008 at 9:04 AM, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > > How can I make a Update of a column in a very large table for all rows > > without using the double amount of disc space and without any need for > > atomic operation? > > > > I have a very large table with about 60 million rows. I sometimes need > > to do a simple update to ALL rows that resets a status-flag to zero. > > Perhaps you should rethink your data model.
for example: *) change status-flag to a timestamp *) make a new table (status_reset or something) with one column, one row...and *) make a view (perhaps swapping names with your original table) that joins the two tables and preserves the 1/0 status flag column appearance so you don't have to change the app. Consider the fundamental tenet: 'If PostgreSQL can't do it well, you are probably doing it the wrong way' :-) merlin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general