Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WAS2G-0002SD-Eh for pgsql-bugs@arkaria.postgresql.org; Mon, 03 Feb 2014 22:30:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WAS2F-00078F-QX for pgsql-bugs@arkaria.postgresql.org; Mon, 03 Feb 2014 22:30:35 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WAS2E-000788-P8 for pgsql-bugs@postgresql.org; Mon, 03 Feb 2014 22:30:34 +0000 Received: from plane.gmane.org ([80.91.229.3]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WAS26-0000RE-IA for pgsql-bugs@postgresql.org; Mon, 03 Feb 2014 22:30:34 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WAS24-0001kf-4P for pgsql-bugs@postgresql.org; Mon, 03 Feb 2014 23:30:24 +0100 Received: from ppp-46-244-214-252.dynamic.mnet-online.de ([46.244.214.252]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Feb 2014 23:30:24 +0100 Received: from spam_eater by ppp-46-244-214-252.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Feb 2014 23:30:24 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-bugs@postgresql.org From: Thomas Kellerer Subject: Re: BUG #9088: default are not working Date: Mon, 03 Feb 2014 23:30:32 +0100 Lines: 20 Message-ID: <52F01888.4020808@gmx.net> References: <20140203222323.13575.44279@wrigleys.postgresql.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ppp-46-244-214-252.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: <20140203222323.13575.44279@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.4 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org plademan@comcast.net wrote on 03.02.2014 23:23:> create table default_test > ( > userId varchar(20) default 'test', > date1 timestamp default now(), > date2 timestamp default current_timestamp, > date3 timestamp default localtimestamp > ); > > insert into default_test > ( userId, date1, date2, date3 ) > values > ( null, null, null, null ); > > select * from default_test; You explicitely stated that you want to put NULL into those columns, therefor the default value does not apply. The default value is only used if the colum is not listed at all in the INSERT statement. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs