From jkanter@virginia.edu Wed Jul 14 16:30:30 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CD076D1B243 for ; Wed, 14 Jul 2004 13:30:30 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 14152-01 for ; Wed, 14 Jul 2004 16:30:13 +0000 (GMT) Received: from unix.mail.Virginia.EDU (unix.mail.Virginia.EDU [128.143.2.28]) by svr1.postgresql.org (Postfix) with ESMTP id 854ADD1B1CE for ; Wed, 14 Jul 2004 13:30:11 -0300 (ADT) Received: from smtp.mail.Virginia.EDU (smtp.mail.Virginia.EDU [128.143.22.52]) by unix.mail.Virginia.EDU (Postfix) with ESMTP id BF137A872 for ; Wed, 14 Jul 2004 12:30:10 -0400 (EDT) Received: from virginia.edu (d-128-19-93.bootp.Virginia.EDU [128.143.19.93]) by smtp.mail.Virginia.EDU (Postfix) with ESMTP id 537862102E for ; Wed, 14 Jul 2004 12:30:10 -0400 (EDT) Message-ID: <40F560AD.8030007@virginia.edu> Date: Wed, 14 Jul 2004 12:34:53 -0400 From: Jodi Kanter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Postgres Admin List Subject: adding defaults Content-Type: multipart/alternative; boundary="------------080600090405030600050405" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.7 tagged_above=0.0 required=5.0 tests=HTML_70_80, HTML_MESSAGE, HTML_TITLE_EMPTY X-Spam-Level: X-Archive-Number: 200407/170 X-Sequence-Number: 14238 This is a multi-part message in MIME format. --------------080600090405030600050405 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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. Thanks Jodi -- /_______________________________ //Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu / / / / / --------------080600090405030600050405 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit 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.
Thanks
Jodi
--
________________________________

_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu


 

 

 

--------------080600090405030600050405-- From olly@lfix.co.uk Wed Jul 14 16:52:34 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 06335D1B248 for ; Wed, 14 Jul 2004 13:52:34 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 22392-04 for ; Wed, 14 Jul 2004 16:52:28 +0000 (GMT) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by svr1.postgresql.org (Postfix) with ESMTP id 998EAD1B1CE for ; Wed, 14 Jul 2004 13:52:26 -0300 (ADT) Received: from lfix.demon.co.uk ([80.177.205.209] helo=cerberus.lfix.co.uk) by anchor-post-35.mail.demon.net with esmtp (Exim 3.35 #1) id 1Bkmza-0003sp-0Z; Wed, 14 Jul 2004 17:52:26 +0100 Received: from linda.lfix.co.uk ([192.168.1.1]) by cerberus.lfix.co.uk with esmtp (Exim 4.34) id 1BkmzV-0003rM-Ed; Wed, 14 Jul 2004 17:52:21 +0100 Subject: Re: adding defaults From: Oliver Elphick Reply-To: olly@lfix.co.uk To: Jodi Kanter Cc: Postgres Admin List In-Reply-To: <40F560AD.8030007@virginia.edu> References: <40F560AD.8030007@virginia.edu> Content-Type: text/plain Organization: LFIX Limited Message-Id: <1089823941.29526.294.camel@linda> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 14 Jul 2004 17:52:21 +0100 Content-Transfer-Encoding: 7bit X-LFIX-MailScanner: Found to be clean X-MailScanner-From: olly@lfix.co.uk X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/171 X-Sequence-Number: 14239 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@lfix.co.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 From peter_e@gmx.net Wed Jul 14 17:09:45 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 83559D1B220 for ; Wed, 14 Jul 2004 14:09:45 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 28700-09 for ; Wed, 14 Jul 2004 17:09:28 +0000 (GMT) Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by svr1.postgresql.org (Postfix) with SMTP id 7D5D3D1B1C7 for ; Wed, 14 Jul 2004 14:09:26 -0300 (ADT) Received: (qmail 16448 invoked by uid 65534); 14 Jul 2004 17:09:25 -0000 Received: from dsl-082-082-233-200.arcor-ip.net (EHLO colt.pezone.net) (82.82.233.200) by mail.gmx.net (mp021) with SMTP; 14 Jul 2004 19:09:25 +0200 X-Authenticated: #495269 From: Peter Eisentraut To: Jodi Kanter , Postgres Admin List Subject: Re: adding defaults Date: Wed, 14 Jul 2004 19:09:24 +0200 User-Agent: KMail/1.5.1 References: <40F560AD.8030007@virginia.edu> In-Reply-To: <40F560AD.8030007@virginia.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200407141909.24359.peter_e@gmx.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/172 X-Sequence-Number: 14240 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 a ALTER COLUMN b SET DEFAULT c; -- Peter Eisentraut http://developer.postgresql.org/~petere/ From rosser.schwarz@gmail.com Wed Jul 14 17:12:23 2004 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0528AD1B269 for ; Wed, 14 Jul 2004 14:12:23 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 30573-04 for ; Wed, 14 Jul 2004 17:12:06 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.195]) by svr1.postgresql.org (Postfix) with SMTP id BCCBBD1B23E for ; Wed, 14 Jul 2004 14:12:03 -0300 (ADT) Received: by mproxy.gmail.com with SMTP id d78so341146rnf for ; Wed, 14 Jul 2004 10:11:52 -0700 (PDT) Received: by 10.38.9.67 with SMTP id 67mr310392rni; Wed, 14 Jul 2004 10:11:51 -0700 (PDT) Message-ID: <37d451f704071410117a8cc088@mail.gmail.com> Date: Wed, 14 Jul 2004 12:11:51 -0500 From: Rosser Schwarz To: Jodi Kanter , pgsql-admin@postgresql.org Subject: Re: adding defaults In-Reply-To: <40F560AD.8030007@virginia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <40F560AD.8030007@virginia.edu> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/173 X-Sequence-Number: 14241 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. $ psql -c "\h alter table" | grep -iC 1 default ALTER TABLE [ ONLY ] name [ * ] ALTER [ COLUMN ] column { SET DEFAULT expression | DROP DEFAULT } ... /rls -- :wq