Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Postgresql function after ALTER SCHEMA public RENAME to public_copy;
CREATE OR REPLACE FUNCTION public.get_locations()
RETURNS SETOF public.locations AS
$BODY$
DECLARE
l_record public.locations;
BEGIN
FOR l_record IN
SELECT * FROM public.locations
ORDER BY location_desc
LOOP
RETURN NEXT l_record;
END LOOP;
END;
$BODY$
LANGUAGE plpgsql VOLATILE SECURITY DEFINER
COST 10
ROWS 10;
CREATE OR REPLACE FUNCTION public_copy.get_locations()
RETURNS SETOF public_copy.locations AS
$BODY$
DECLARE
l_record public.locations;
BEGIN
FOR l_record IN
SELECT * FROM public.locations
ORDER BY location_desc
LOOP
RETURN NEXT l_record;
END LOOP;
END;
$BODY$
LANGUAGE plpgsql VOLATILE SECURITY DEFINER
COST 10
ROWS 10;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.