Re: DEFAULT in update & prepared statements

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Sanjay Minni <sanjay(dot)minni(at)gmail(dot)com>
Cc: "pgsql-sql(at)lists(dot)postgresql(dot)org" <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re: DEFAULT in update & prepared statements
Date: 2023-11-08 17:21:20
Message-ID: CAKFQuwZ0+0GyZytpska6ybFNHLBKg9GKr_czPvBmhg6uQmh2ow@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wednesday, November 8, 2023, Sanjay Minni <sanjay(dot)minni(at)gmail(dot)com> 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.

David J.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David G. Johnston 2023-11-08 17:30:23 Re: DEFAULT in update & prepared statements
Previous Message Sanjay Minni 2023-11-08 16:02:16 DEFAULT in update & prepared statements