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 1mxAOK-0003qA-Gl for pgsql-general@arkaria.postgresql.org; Tue, 14 Dec 2021 16:11:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mxAOJ-0001fW-1s for pgsql-general@arkaria.postgresql.org; Tue, 14 Dec 2021 16:10:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxAOI-0001fG-NR for pgsql-general@lists.postgresql.org; Tue, 14 Dec 2021 16:10:58 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxAOF-0008NH-UA for pgsql-general@lists.postgresql.org; Tue, 14 Dec 2021 16:10:57 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 64C063200AF0; Tue, 14 Dec 2021 11:10:54 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 14 Dec 2021 11:10:54 -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=S PMIT9fYbWKd4tKA/mplBvEgJ9EPAOGr3z/yJXdSyqs=; b=FicjtTHR1P9gfSoGa KXmi//zTX5HnssbP85w7krv5JVFQ+BRpeqgWd8tOPc4BplzxGIZO9+g9HM9znw4J COWqRYurifkGAG04ob2IWW5uPzToATNXwm8nzfH+c9SFpH2usMgHKD+/j/K1Ivig gZPqYkp4TR3r4iHVSnA5bwAguz1fWOP2KuDpVAeC0v07NBSSxg5kgXv9vCFqUR3Z 6APdUfxWTT6XbW6vOFnIGN/R/ukGNQDHAsK09u4mstEpV0/s5hPckGpyWldqmRrT vXxdkFwPP2HoMDTrWVych/I9ouHVHeTyJn8/HPpCzRueu/uyyqubJ+ppaRT9hNM/ +Y7Mg== 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=SPMIT9fYbWKd4tKA/mplBvEgJ9EPAOGr3z/yJXdSy qs=; b=lW7/EVosUT+p+2M/4GoYz5ukrqJG1Us7Wn4wLX3yGAKAJrnXOKWByG/M/ SaeTc2eueB4T0q6B2QrIa7AkLyxB90mS1zInjHitFqso9E8fdlMFnuXxUpxROPwl RKB+yGZb4cBrYuW0p0AumwMlhGSGVNP1Aoo9tQcPdTRtes4ZGZK5vW0mtg7CT+45 CRk80Opb0ZhXbo34HaHOXFOy2pa0WgZvBi7uydtukmm6O4pZdflanCDY195c7r2a 8H7OohMIAJ3BSNSB0CtG0V3eOm7UMxJ9bz+94sna7w28wcNceE6aBmfg/aUujFdL rjYpsixLiF2UiGN+MSrECyo3tZfVg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrledtgdekiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuggftrfgrthhtvghrnhepvedvkeeihfduhffhtdekleegffduiefgteejgeffgffh teefleeludfgleelgeevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 14 Dec 2021 11:10:53 -0500 (EST) Message-ID: Date: Tue, 14 Dec 2021 08:10:52 -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 08:00, Sanjay Minni wrote: > Its an insert and my insert SQL contains the column timestamp and value > nil. > Will it work if the SQL contains timestamp through value is nil No nil(NULL) is a valid value for the field as you have not specified NOT NULL on the column. If you do add that constraint you will get an error with your inserts. If you want the DEFAULT to work you will need to not include the "timestamp"(FYI, not a good choice for a name) field in the INSERT. > > On Tue, 14 Dec, 2021, 9:20 pm Adrian Klaver,