Re: BUG #18007: age(timestamp, timestamp) is marked as immutable, but using age(date, date) says it's not

From: Braiam <braiamp(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: braiamp+pg(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18007: age(timestamp, timestamp) is marked as immutable, but using age(date, date) says it's not
Date: 2023-06-29 18:23:33
Message-ID: CAG=7Bt-TzFaQPO=CEOqRoLTipMDwF+x1BLkzkyZbVgC_k_gh_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Jun 29, 2023 at 1:45 PM David G. Johnston
<david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
> On Thu, Jun 29, 2023 at 10:36 AM PG Bug reporting form <noreply(at)postgresql(dot)org> wrote:
>>
>> The following bug has been logged on the website:
>>
>> Bug reference: 18007
>> Logged by: Braiam Peguero
>> Email address: braiamp+pg(at)gmail(dot)com
>> PostgreSQL version: 15.3
>> Operating system: Debian
>> Description:
>>
>> There's no much difference between timestamp and dateT00:00:00.000, yet
>> using age(date, date)
>
>
> There is no "age(date, date)" function. Only age(timestamp, timestamp)
>
>> for some reason internally doesn't type coerce
>> correctly into the appropriated types.
>
>
> Nope, type coercion happens before the function call, while figuring out which function signature to choose.
>
>>
>> I remember that on a previous
>> versions (not sure if it was 14) this wasn't the case, so I would consider
>> this a regression.
>
>
> You haven't provided any code demonstrating what you think is incorrect.

create temporary table test (
start_date date not null,
end_date date not null
);
alter table test add column time_elapsed interval generated always as
(age(end_date, start_date)) stored;

> David J.
>

--
Braiam

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2023-06-29 18:24:47 Re: BUG #18007: age(timestamp, timestamp) is marked as immutable, but using age(date, date) says it's not
Previous Message Braiam 2023-06-29 18:20:44 Re: BUG #18007: age(timestamp, timestamp) is marked as immutable, but using age(date, date) says it's not