Re: Adding a default value to a column after it exists

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Adding a default value to a column after it exists
Date: 2011-04-13 16:29:27
Message-ID: 6519.1302712167@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com> writes:
> Is there a way to add a default value definition to an existing column? Something like an "alter table... alter column... default 'foo'".

ALTER TABLE ... ALTER COLUMN ... SET DEFAULT ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2011-04-13 16:31:21 Re: Adding a default value to a column after it exists
Previous Message Mike Fowler 2011-04-13 16:25:05 Re: Adding a default value to a column after it exists