Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxA4c-0001NF-Ek for pgsql-general@arkaria.postgresql.org; Tue, 14 Dec 2021 15:50:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mxA4b-00006F-5x for pgsql-general@arkaria.postgresql.org; Tue, 14 Dec 2021 15:50:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxA4Z-0008VC-6C for pgsql-general@lists.postgresql.org; Tue, 14 Dec 2021 15:50:36 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxA4U-0003TN-T3 for pgsql-general@lists.postgresql.org; Tue, 14 Dec 2021 15:50:34 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 19CF63200F81; Tue, 14 Dec 2021 10:50:27 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 14 Dec 2021 10:50:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= message-id:date:mime-version:subject:to:references:from :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=L MfMgmL5dofNLhakz/gFrqArTUS1eVy1r7fRAyOB0sY=; b=lmkTCXc9RUka//mDG JFoUItRCpMb/bXIdRL0tpUddVstcIhZMDbay+CMrTo9gzetdZorGvJKRVj4Vw6wD RPYwM5kqsoSXWayqtJ3lixH0WMv9ZnbwqDA3RL5BS7+zAlVeOA92xegiBxgVwWI5 n1thR0ok6m9z4wrU6kFgHYRXdid4RWysA7eyZA7j/sVdCfTQb6fG65G0o/5CjZhF kKuRTZoZIHVs6R6W4wTMD8zXUST9cnsKSbg9xFcw967d+ENOanPNMolwF99oISLq pHwN8Foavt8Id72g8yYntNmkiEellL9+VmHmlp9jDeIPV+TxyTPt0Hy6HH/M2qS2 htP+A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=LMfMgmL5dofNLhakz/gFrqArTUS1eVy1r7fRAyOB0 sY=; b=IXl53OUJtQbOjaS1vm0KA4CfIYLupwy0q3/9WNs5eHUaMz1OoIR74o0uE FnYkpPqZkSZVKs+hnFWYhZRNWwQfb83N7oxVrFi1gvdKPGStxiNWJnWOunHosKVx U7PBMt3tJnXrVmMt9/Y/e99dijEltKEkxTxKupNeWU4qeXJnhJB+z0siIZDsLMZh dTOdROIeM4o14Z2h1RjVM6ywUugRnz3JmxDR2myMGfi/GDNjT8ebaRrM80XsxV1Q ZCvX7GBEmw59B3c+wQv7obfd0O9d4IsKX+HGoRR+T6z6nwtMVYjWR/dXhvaMhLZT IP95c1jdcK0Np6mb7PC9G7J1wxDtA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrledtgdekvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuggftrfgrthhtvghrnhepvedvkeeihfduhffhtdekleegffduiefgteejgeffgffh teefleeludfgleelgeevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Dec 2021 10:50:25 -0500 (EST) Message-ID: Date: Tue, 14 Dec 2021 07:50:25 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: timestamp default current_timestamp not working Content-Language: en-US To: Sanjay Minni , pgsql-general@lists.postgresql.org References: From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/14/21 07:36, Sanjay Minni wrote: > Hi > > I am not getting the timestamp value which i am expecting to be > automatically inserted in the column defined: > ... > "timestamp" timestamp with time zone DEFAULT CURRENT_TIMESTAMP, > ... > (I see the above definition in pgadmin4 in the tab SQL. > I have set it thru pgadmin4 table->properties->columns by entering > CURRENT_TIMESTAMP in the default column) > > why is the timestamp value not being automatically inserted by the system 1) It is a DEFAULT value so if a value is provided in the INSERT that will be used. 2) DEFAULT values only apply to INSERTs not UPDATEs. > > with warm regards > Sanjay Minni -- Adrian Klaver adrian.klaver@aklaver.com