-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Hello,
I've been able to successfully dump a function definition that is roughly defined as this:
CREATE FUNCTION stable_id(entity_id uuid, value character varying) RETURNS uuid
LANGUAGE sql IMMUTABLE
AS $$
SELECT uuid_generate_v5('c4d38f4d-f7a8-4ab9-afad-e4f18e05242c', entity_id::varchar || ' ' || value)
$$;When run, pgschema dump produces the following output:
--
-- pgschema database dump
--
-- Dumped from database version PostgreSQL 17.0
-- Dumped by pgschema version 1.4.0
--
-- Name: stable_id; Type: FUNCTION; Schema: -; Owner: -
--
CREATE OR REPLACE FUNCTION stable_id(
entity_id uuid,
value character varying
)
RETURNS uuid
LANGUAGE sql
SECURITY INVOKER
IMMUTABLE
AS $$
SELECT uuid_generate_v5('c4d38f4d-f7a8-4ab9-afad-e4f18e05242c', entity_id::varchar || ' ' || value)
$$;And if I feed that file back into pgschema plan I get the following plan:
DROP FUNCTION IF EXISTS stable_id(uuid, character varying);
CREATE OR REPLACE FUNCTION stable_id(
entity_id uuid,
value varchar
)
RETURNS uuid
LANGUAGE sql
SECURITY INVOKER
IMMUTABLE
AS $$
SELECT uuid_generate_v5('c4d38f4d-f7a8-4ab9-afad-e4f18e05242c', entity_id::varchar || ' ' || value)
$$;As far as I can tell the only difference from the original definition is the SECURITY INVOKER clause, I'm not sure it's necessarily correct to add the clause in all situations but nevertheless it makes sense here. However, after applying the plan pgschema plan continues to generate the same plan with no changes. Any idea what might be causing this?
Reactions are currently unavailable