Skip site navigation (1) Skip section navigation (2)

Re: adding defaults

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Jodi Kanter <jkanter(at)virginia(dot)edu>
Cc: Postgres Admin List <pgsql-admin(at)postgresql(dot)org>
Subject: Re: adding defaults
Date: 2004-07-14 16:52:21
Message-ID: 1089823941.29526.294.camel@linda (view raw or flat)
Thread:
Lists: pgsql-admin
On Wed, 2004-07-14 at 17:34, Jodi Kanter wrote:
> Can field specific defaults easily be added to a table that is already
> in existence and has data in it?  I cannot seem to locate the correct
> ALTER command in any of my books.

ALTER TABLE table ALTER COLUMN column SET DEFAULT expression

-- 
Oliver Elphick                                          olly(at)lfix(dot)co(dot)uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
                 ========================================
     "God is faithful, by whom ye were called unto the 
      fellowship of his Son Jesus Christ our Lord."         
                                   I Corinthians 1:9 


In response to

pgsql-admin by date

Next:From: Peter EisentrautDate: 2004-07-14 17:09:24
Subject: Re: adding defaults
Previous:From: Jodi KanterDate: 2004-07-14 16:34:53
Subject: adding defaults

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group