Re: Partition prune with stable Expr

From: Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>
To: Thomas Kellerer <shammat(at)gmx(dot)net>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Partition prune with stable Expr
Date: 2020-09-28 23:13:00
Message-ID: CAKU4AWoyY6-_KMEKKbm8Oi9DtZDf4wkxq31ouSZ9o79zOhRdGw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 28, 2020 at 9:17 PM Thomas Kellerer <shammat(at)gmx(dot)net> wrote:

> Andy Fan schrieb am 28.09.2020 um 02:54:
> > Well, that's very interesting. Specific to my user case,
> > SELECT * FROM p WHERE pkey = to_date('2018-12-13', 'yyyy-mm-dd)';
>
> Why use to_date() at all for a constant value?
> Can't you use a standard ANSI date literal (date '2018-12-13')?
>
>
This is from lots of legacy code from Oracle and the real case is
to_date('20181213', 'yyyymmdd').

Alternatively, you could use make_date(2018,12,13) which is marked as
> immutable.
>
>
Thanks, Nice to know make_date function.

--
Best Regards
Andy Fan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2020-09-28 23:26:02 Re: Small improvements to pg_list.h's linitial(), lsecond(), lthird() etc macros
Previous Message Tom Lane 2020-09-28 23:08:57 Re: Planner making bad choice in alternative subplan decision