Re: Help with ADD COLUMN

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Help with ADD COLUMN
Date: 2002-11-24 06:28:12
Message-ID: 24319.1038119292@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au> writes:
> The one big programming difficulty I see is the process of running through
> all the existing tuples in the relation the column was added to and
> evaluating the default for each row.

Basically you wanna do an "UPDATE tab SET col = <default expr>". I'd
suggest letting the existing machinery handle as much of that as
possible.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 2002-11-24 06:34:22 Re: Help with ADD COLUMN
Previous Message Masaru Sugawara 2002-11-24 04:26:32 Re: quote_ident and schemas (was Re: connectby with schema)