Answer the question
In order to leave comments, you need to log in
How to make an extension roamable?
I don't know how to make the extension relocatable. Question: how to make an extension moveable to another schema. The beginning is described below. After that, operators, functions, variances, mathematical expectation are created.
create schema IF NOT EXISTS complex;
--Математическое ожидание
--создание комплексного типа данных
create type complex.complex as (re float, im float);
--создание комплексного типа данных с суммой комплексных чисел и количеством чисел
create type complex.complexSumAndCount as (complexSumVar complex.complex, complexCount integer);
--Создание функции сложения комплексных чисел
CREATE or REPLACE function complex.complexSumFunction (sum complex.complex, complexTempVar complex.complex)
RETURNS complex.complex as
$$
BEGIN
IF sum is not null and complexTempVar is not null then
sum.re := coalesce(sum.re, 0) + coalesce(complexTempVar.re, 0);
sum.im := coalesce(sum.im, 0) + coalesce(complexTempVar.im, 0);
end IF;
RETURN sum;
end;
$$
LANGUAGE plpgSQL;
Answer the question
In order to leave comments, you need to log in
https://www.postgresql.org/docs/current/extend-ext...
A fully relocatable extension can be moved into another schema at any time, even after it's been loaded into a database. This is done with the ALTER EXTENSION SET SCHEMA command, which automatically renames all the member objects into the new schema. Normally, this is only possible if the extension contains no internal assumptions about what schema any of its objects are in. Also, the extension's objects must all be in one schema to begin with (ignoring objects that do not belong to any schema, such as procedural languages). Mark a fully relocatable extension by setting relocatable = true in its control file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question