From ab44d0c121f35cb0bd9be7e187fabb95e087bb70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Aur=C3=A9lio=20Silva=20de=20Souza=20J=C3=BAnior?= <57829631+markgomer@users.noreply.github.com> Date: Tue, 27 Dec 2022 14:16:18 -0300 Subject: [PATCH] Changed age_id, age_start_id and age_end_id function signatures to IMMUTABLE (#405) * Changed some function signatures to IMMUTABLE Changed age_id(agtype), age_start_id(agtype) and age_end_id(agtype) from STABLE to IMMUTABLE. * Revert "Changed some function signatures to IMMUTABLE" This reverts commit 92ac40d15f3eb90812323370bf1be23e7526e623. * Changed age_id signature to IMMUTABLE * Function signature was changed from STABLE to IMMUTABLE; * Function receives a vertex or edge container (or null), and analyze its contents to return the "id" stored in said container; * As it acts only on its arguments, it will always return the same result, given the same arguments, even across multiple SQL statements, being classified as IMMUTABLE function. * Changed age_start_id signature to IMMUTABLE * Function signature was changed from STABLE to IMMUTABLE; * Function receives an edge container (or null), and analyze its contents to return the "start_id" stored in said container; * As it acts only on its arguments, it will always return the same result, given the same arguments, even across multiple SQL statements, being classified as IMMUTABLE function. * Changed age_end_id signature to IMMUTABLE * Function signature was changed from STABLE to IMMUTABLE; * Function receives an edge container (or null), and analyze its contents to return the "end_id" stored in said container; * As it acts only on its arguments, it will always return the same result, given the same arguments, even across multiple SQL statements, being classified as IMMUTABLE function. --- age--1.1.1.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/age--1.1.1.sql b/age--1.1.1.sql index 8a4c1a826..692e95603 100644 --- a/age--1.1.1.sql +++ b/age--1.1.1.sql @@ -3413,7 +3413,7 @@ AS 'MODULE_PATHNAME'; CREATE FUNCTION ag_catalog.age_id(agtype) RETURNS agtype LANGUAGE c -STABLE +IMMUTABLE RETURNS NULL ON NULL INPUT PARALLEL SAFE AS 'MODULE_PATHNAME'; @@ -3421,7 +3421,7 @@ AS 'MODULE_PATHNAME'; CREATE FUNCTION ag_catalog.age_start_id(agtype) RETURNS agtype LANGUAGE c -STABLE +IMMUTABLE RETURNS NULL ON NULL INPUT PARALLEL SAFE AS 'MODULE_PATHNAME'; @@ -3429,7 +3429,7 @@ AS 'MODULE_PATHNAME'; CREATE FUNCTION ag_catalog.age_end_id(agtype) RETURNS agtype LANGUAGE c -STABLE +IMMUTABLE RETURNS NULL ON NULL INPUT PARALLEL SAFE AS 'MODULE_PATHNAME';