Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Не работает регистрация составного ключа #183

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:

  1. Создаю свой тип CREATE TYPE partition_key_year_and_month AS (year float8, month float8);
  2. SELECT create_naming_sequence('message');
  3. На выполнение запроса 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /