Re: How to set up a schema default date to '2020-01-01'?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: mark armon <1994hejian(at)gmail(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: How to set up a schema default date to '2020-01-01'?
Date: 2020-11-10 05:29:10
Message-ID: CAKFQuwaoG9KuZTHCtWFyyYT_+TurOc3_WHW+_3K1rgjJkJMKcg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Nov 9, 2020 at 10:21 PM mark armon <1994hejian(at)gmail(dot)com> wrote:

> like I create a schema: test, I want the default date to 2020-01-01, so
> when I do
>
> select test.now;
>
> the result is 2020-01-01
>
That is not presently a feature that PostgreSQL implements.

While you can leverage probably a custom configuration variable it might be
less subtle to simply store the desired reference in a SQL function and
then call the function.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message raf 2020-11-10 05:36:20 Re: How to set up a schema default date to '2020-01-01'?
Previous Message mark armon 2020-11-10 05:21:02 Re: How to set up a schema default date to '2020-01-01'?