-
Notifications
You must be signed in to change notification settings - Fork 69
Open
@Lispython
Description
Тестирую возможность расширения для секционирования таблиц.
Создал таблицу следующей структуры:
Table "public.message"
Column | Type | Collation | Nullable | Default
-----------------------+--------------------------+-----------+----------+-------------------------------------------------
id | integer | | not null | nextval('message_id_seq'::regclass)
created_at | timestamp with time zone | | not null | now()
status | integer | | |
transaction_id | character varying(124) | | not null |
Indexes:
"message_pkey" PRIMARY KEY, btree (id)
"message_transaction_id__pkey" UNIQUE CONSTRAINT, btree (transaction_id)
"message_created_at__idx" btree (created_at)
Хочу секционировать таблицу по месяцам с использованием составного ключа по документации https://postgrespro.ru/docs/postgrespro/10/pg-pathman#PG-PATHMAN-INTERNALS:
- Создаю свой тип
CREATE TYPE partition_key_year_and_month AS (year float8, month float8);
SELECT create_naming_sequence('message');
- На выполнение запроса
SELECT add_to_pathman_config('message', '(extract(year from created_at), extract(month from created_at))::partition_key_year_and_month', NULL);
вылетает следующая ошибка:
ERROR: failed to analyze partitioning expression "(extract(year from created_at), extract(month from created_at))::partition_key_year_and_month"
DETAIL: functions in partitioning expression must be marked IMMUTABLE
Environment
extname | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition
------------+----------+--------------+----------------+------------+---------------+--------------
plpgsql | 10 | 11 | f | 1.0 | |
pg_pathman | 10 | 2200 | f | 1.5 | {16387,16398} | {"",""}
version
----------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 11.0 (Debian 11.0-1.pgdg90+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
(1 row)
ERROR: function get_pathman_lib_version() does not exist
LINE 1: SELECT get_pathman_lib_version();
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Metadata
Metadata
Assignees
Labels
No labels