Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0mF4-007mKU-PN for pgsql-sql@arkaria.postgresql.org; Wed, 08 Nov 2023 17:21:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r0mF3-006HGs-CZ for pgsql-sql@arkaria.postgresql.org; Wed, 08 Nov 2023 17:21:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r0mF3-006HGk-3k for pgsql-sql@lists.postgresql.org; Wed, 08 Nov 2023 17:21:25 +0000 Received: from mail-oo1-xc36.google.com ([2607:f8b0:4864:20::c36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1r0mF0-005O06-Sm for pgsql-sql@lists.postgresql.org; Wed, 08 Nov 2023 17:21:24 +0000 Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-581fb6f53fcso4266069eaf.2 for ; Wed, 08 Nov 2023 09:21:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699464081; x=1700068881; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Ok5XLcVnx+sl6Rax+ISBPw2JxsHXS2AQr56/wHlLlpg=; b=ZO5gnVlTuaIVs0BK9RixWfcX4LzlId1JSoF7p1AnB2JdRCHPI0KSI0blv2VkR9kM97 02fw9j69e5iEDrlTR7gOmsQMG/ulnGoOUbL6qnybqgslYeZBo7vYd5xyCJWwUQup1Gek FfxdUWkipjF0uQyWewHWOeyKGjyJka8C7Whlyom3ARXk/KsjGfoGV+IlVEztinEZJ1KC TbREE8M2J1TLP8kIQgYw/X/NY8sn0i4RvNGUrRuiEOgGF812tZ/2gxHklSXx1MtiBVOY gsRwHWEMVy5F1aeMxbaghakJ07x3PBRGbgCCm4Ng3obhM+5eiA/4rTmQpoFpmcQQF47p Po9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699464081; x=1700068881; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ok5XLcVnx+sl6Rax+ISBPw2JxsHXS2AQr56/wHlLlpg=; b=YqdlldPLIcptnbv9tw4zSwP5s0ILxGKJc9LI01aGjIZKV62YRZSAglHyMXOmCIDIvF 76vgi1S+lWD51zC/+e6MR/5l6ZfRD9rcxC9DuGJrqjvICbOWt/fs1PDNNZh0jfaAaTvG 38wZi01IQc7MACoYdx9WGjVcs945IP2vY9YGrJ3tMe+BcCOWoeA/l5X24cZwvmOJvumt iSivy5wKUUP12veDxqYq6NiDsFG38AcQX4C0FtkawmqpyNA00+b2G7KaE3Rr0y+Y2uWa Lt0dAGqrNA+RdA3P6+skaF/b6beiGVeHcPGPjRdnoc8u5n4wm8wzPE3RCkY1MzWYKxmt 53gA== X-Gm-Message-State: AOJu0YyPgIEkXDyALk8KE2BAbHv7Wi/JqFr2HkO7ouOlIaLFciRURJX6 vm2QJQVc+JcSpnMTJvN/IAYU13nVHwt7EoyImh0= X-Google-Smtp-Source: AGHT+IGBmIOPlD+vVNHplMmww8eZUXCb59mZUMmUVJyPQ489aOVjptYOXWlEZF6HPIxJa4KOPpaw59zod3B4tDYcnf0= X-Received: by 2002:a05:6820:627:b0:57b:6c85:972 with SMTP id e39-20020a056820062700b0057b6c850972mr2711233oow.0.1699464080574; Wed, 08 Nov 2023 09:21:20 -0800 (PST) MIME-Version: 1.0 Received: by 2002:ac9:5989:0:b0:4f6:384b:17ef with HTTP; Wed, 8 Nov 2023 09:21:20 -0800 (PST) In-Reply-To: References: From: "David G. Johnston" Date: Wed, 8 Nov 2023 10:21:20 -0700 Message-ID: Subject: Re: DEFAULT in update & prepared statements To: Sanjay Minni Cc: "pgsql-sql@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000d4cabb0609a75089" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d4cabb0609a75089 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wednesday, November 8, 2023, Sanjay Minni wrote= : > Can DEFAULT (defined for a timestamp column as now() ) be used in > 1. prepared statement i.e. EXECUTE ( ..., DEFAULT, ...) > 2. in an UPDATE statement UPDATE TABLE SET update_time =3D DEFAULT .. > 5 seconds looking at the syntax for update in the docs answers the second question. The first question doesn=E2=80=99t really make sense - but regardless of wh= at you are trying to communicate there just try it. If the result you get doesn= =E2=80=99t make sense post what you tried. David J. --000000000000d4cabb0609a75089 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wednesday, November 8, 2023, Sanjay Minni <sanjay.minni@gmail.com> wrote:
Can DEFAULT (defined for a timestamp column as no= w() ) be used in
1. prepared statement i.e. EXECUTE ( ..., DEFAULT, ...)2. in an UPDATE statement=C2=A0 UPDATE TABLE SET update_time =3D DEFAULT .= .

5 seconds looking at the synt= ax for update in the docs answers the second question.

=
The first question doesn=E2=80=99t really make sense - but regardless = of what you are trying to communicate there just try it.=C2=A0 If the resul= t you get doesn=E2=80=99t make sense post what you tried.

David J.
=C2=A0
--000000000000d4cabb0609a75089--