Re: is date_part immutable or not?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Олег Самойлов <splarv(at)ya(dot)ru>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: is date_part immutable or not?
Date: 2020-08-21 13:14:41
Message-ID: fedfc3e1cc720ea37c40ba4793835615aead208e.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2020-08-21 at 14:57 +0300, Олег Самойлов wrote:
> Just create partitioned table for PostgreSQL logs
>
> CREATE TABLE pglog.pglog (
> log_time timestamp(3) with time zone,
> [...]
> ) PARTITION BY LIST (date_part('isodow', log_time));
>
> ERROR: functions in partition key expression must be marked IMMUTABLE

Two approaches:

1. Use "timestamp without time zone".

2. Partition in some other way, for example BY RANGE (log_time).
Your list partitions don't make a lot of sense to me.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Олег Самойлов 2020-08-21 13:36:57 Re: is date_part immutable or not?
Previous Message Laurenz Albe 2020-08-21 13:10:30 Re: When are largobject records TOASTed into pg_toast_2613?