Re: is date_part immutable or not? - Mailing list pgsql-general

From Laurenz Albe
Subject Re: is date_part immutable or not?
Date
Msg-id fedfc3e1cc720ea37c40ba4793835615aead208e.camel@cybertec.at
Whole thread Raw
In response to is date_part immutable or not?  (Олег Самойлов <splarv@ya.ru>)
Responses Re: is date_part immutable or not?  (Олег Самойлов <splarv@ya.ru>)
List 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




pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: When are largobject records TOASTed into pg_toast_2613?
Next
From: Олег Самойлов
Date:
Subject: Re: is date_part immutable or not?