Re: is date_part immutable or not?

Поиск
Список
Период
Сортировка
Искать
От
Laurenz Albe
Тема
Re: is date_part immutable or not?
Дата
Msg-id
fedfc3e1cc720ea37c40ba4793835615aead208e.camel@cybertec.at
Ответ на
is date_part immutable or not? (Олег Самойлов)
Список
Дерево обсуждения
is date_part immutable or not? Олег Самойлов <splarv@ya.ru>
Re: is date_part immutable or not? Олег Самойлов <splarv@ya.ru>
Re: is date_part immutable or not? Laurenz Albe <laurenz.albe@cybertec.at>
Re: is date_part immutable or not? Олег Самойлов <splarv@ya.ru>
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 по дате отправления
От: Laurenz Albe
Дата:
От: Олег Самойлов
Дата:
FAQ