The code displayed by pgAdmin, for a function I have created, does not
allow me to recreate the function as I would like. If I run :-
CREATE SCHEMA "Security" AUTHORIZATION postgres;
CREATE TABLE "Security"."CentreGroupPolicy"
( "CentreGroupPolicyID" bigint NOT NULL
)
WITHOUT OIDS;
CREATE OR REPLACE FUNCTION
"Security"."CentreGroupPolicyDetailsGet1"(INOUT "pCentreGroupPolicyID"
bigint) AS
$BODY$
BEGIN SELECT INTO "pCentreGroupPolicyID" cgp."CentreGroupPolicyID" FROM "Security"."CentreGroupPolicy"
cgp WHERE cgp."CentreGroupPolicyID" = "pCentreGroupPolicyID";
END;
$BODY$ LANGUAGE 'plpgsql' STABLE;
Then pgAdmin shows me:-
CREATE OR REPLACE FUNCTION
"Security"."CentreGroupPolicyDetailsGet1"(INOUT pCentreGroupPolicyID
bigint) AS
$BODY$
BEGIN SELECT INTO "pCentreGroupPolicyID" cgp."CentreGroupPolicyID" FROM "Security"."CentreGroupPolicy"
cgp WHERE cgp."CentreGroupPolicyID" = "pCentreGroupPolicyID";
END;
$BODY$ LANGUAGE 'plpgsql' STABLE;
Which does not run.
If instead I use:-
CREATE OR REPLACE FUNCTION
"Security"."CentreGroupPolicyDetailsGet1"(INOUT pCentreGroupPolicyID
bigint) AS
$BODY$
BEGIN SELECT INTO pCentreGroupPolicyID cgp."CentreGroupPolicyID" FROM "Security"."CentreGroupPolicy" cgp
WHERE cgp."CentreGroupPolicyID" = pCentreGroupPolicyID;
END;
$BODY$ LANGUAGE 'plpgsql' STABLE;
pgAdmin gives me:-
CREATE OR REPLACE FUNCTION
"Security"."CentreGroupPolicyDetailsGet1"(INOUT pcentregrouppolicyid
bigint) AS
$BODY$
BEGIN SELECT INTO pCentreGroupPolicyID cgp."CentreGroupPolicyID" FROM "Security"."CentreGroupPolicy" cgp
WHERE cgp."CentreGroupPolicyID" = pCentreGroupPolicyID;
END;
$BODY$ LANGUAGE 'plpgsql' STABLE;
and the case no longer matches for the parameter.
Is it possible to make it more consistent?