X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id 6711611F7700 for ; Wed, 19 Apr 2006 04:45:00 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.599 X-Spam-Level: X-Spam-Status: No, score=-2.599 required=5 tests=[BAYES_00=-2.599, MSGID_FROM_MTA_HEADER=0] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id quKlPVMxoxzx for ; Wed, 19 Apr 2006 04:44:54 -0300 (ADT) X-Greylist: delayed 00:33:19.952002 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 1C33611F6F8E for ; Wed, 19 Apr 2006 04:44:44 -0300 (ADT) Received: from cluster-b.mailcontrol.com (cluster-b.mailcontrol.com [217.68.146.190]) by svr4.postgresql.org (Postfix) with ESMTP id EB6DA5AFAB2 for ; Wed, 19 Apr 2006 06:53:22 +0000 (GMT) Received: from glenis.uk1.openworld.co.uk (glenis.uk1.openworld.co.uk [82.211.89.4]) by rly18b.srv.mailcontrol.com (MailControl) with ESMTP id k3J6rHVo000891 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 19 Apr 2006 07:53:18 +0100 Message-Id: <200604190653.k3J6rHVo000891@rly18b.srv.mailcontrol.com> Received: from [203.115.30.220] (helo=Thusitha) by glenis.uk1.openworld.co.uk with esmtpsa (TLSv1:RC4-MD5:128) (Exim 4.50) id 1FW6Yz-0006yx-HY for pgsql-admin@postgresql.org; Wed, 19 Apr 2006 06:53:22 +0000 Reply-To: From: "Thusitha Kodikara" To: Subject: Different results when specifying DEFAULT values through ALTER TABLE Date: Wed, 19 Apr 2006 12:28:27 +0530 Organization: Open World Lanka (Pvt) Limited MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Thread-Index: AcZjfqjY0PNhjl3DTomYisrUS7/PxA== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Scanned-By: MailControl A-06-00-05 (www.mailcontrol.com) on 10.66.0.128 X-Archive-Number: 200604/177 X-Sequence-Number: 21346 Hi, I observed the following on PostgreSQL 8.1.3 (on Windows 2000). (1) alter table invoice add column active boolean default true; This will add a new column "active" with a default clause as "true" and als= o sets the value "true" to all existing rows of the table. BUT (2) ALTER TABLE invoice ADD COLUMN active boolean; ALTER TABLE invoice ALTER COLUMN active SET DEFAULT true; Will result in only adding the column "active" with default clause as "true= ". It will NOT set the value "true" for existing rows. Is there a particular reason for this difference in behaviour? (Or am I mis= sing something in the syntax?) Thanks and regards, -Thusitha Kodikara=20 --=20=20 CONFIDENTIALITY NOTICE The information contained in this message is confidential, intended only for the use of the individual or the entity named as recipient. If the reader of this message is not that recipient, you are notified that any dissemination, distribution or copy of this message is strictly prohibited. If you have received this message in error, please immediately notify us by telephone on the number above. Your co-operation is appreciated.