public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: Sanjay Minni <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: DEFAULT in update & prepared statements
Date: Wed, 8 Nov 2023 10:30:23 -0700
Message-ID: <CAKFQuwYK9OqAqN9DzFqK9=kaU_rxxFQWFsxTaKdLpsM0VH6SJg@mail.gmail.com> (raw)
In-Reply-To: <CAKFQuwZ0+0GyZytpska6ybFNHLBKg9GKr_czPvBmhg6uQmh2ow@mail.gmail.com>
References: <CAMpxBo=M35hcH1g4Vg=KRJ0-77FOJcvdrdiVF5KSOAdOG-LvKQ@mail.gmail.com>
	<CAKFQuwZ0+0GyZytpska6ybFNHLBKg9GKr_czPvBmhg6uQmh2ow@mail.gmail.com>

On Wednesday, November 8, 2023, David G. Johnston <
[email protected]> wrote:

> On Wednesday, November 8, 2023, Sanjay Minni <[email protected]>
> 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 = DEFAULT ..
>>
>
> 5 seconds looking at the syntax for update in the docs answers the second
> question.
>
> The first question doesn’t really make sense - but regardless of what you
> are trying to communicate there just try it.  If the result you get doesn’t
> make sense post what you tried.
>

As the docs do not show DEFAULT for execute the answer is indeed no for the
first question.  Default behaves as syntax for the query and syntax, like
identifiers, cannot be parameterized.

David J.


view thread (3+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: DEFAULT in update & prepared statements
  In-Reply-To: <CAKFQuwYK9OqAqN9DzFqK9=kaU_rxxFQWFsxTaKdLpsM0VH6SJg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox