-- -- PostgreSQL database dump -- -- Dumped from database version 11devel -- Dumped by pg_dump version 11devel SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalog.set_config('search_path', '', false); SET check_function_bodies = false; SET client_min_messages = warning; SET row_security = off; -- -- Name: upper2(text); Type: FUNCTION; Schema: public; Owner: postgres -- CREATE FUNCTION public.upper2(text) RETURNS text LANGUAGE sql AS $_$SELECT upper($1)$_$; ALTER FUNCTION public.upper2(text) OWNER TO postgres; -- -- Name: upper3(text); Type: FUNCTION; Schema: public; Owner: postgres -- CREATE FUNCTION public.upper3(text) RETURNS text LANGUAGE sql -- IMMUTABLE is optional for indexed SQL functions -- schema qualifying the call to upper2 works, i.e. public.upper2() AS $_$SELECT upper2($1)$_$; -- -- THIS PL/pgSQL FUNCTION WORKS SINCE IT IS NOT INLINED -- CREATE FUNCTION public.upper3(text) RETURNS text LANGUAGE plpgsql IMMUTABLE AS $_$BEGIN RETURN upper2($1) END$_$; ALTER FUNCTION public.upper3(text) OWNER TO postgres; SET default_tablespace = ''; SET default_with_oids = false; -- -- Name: test; Type: TABLE; Schema: public; Owner: postgres -- CREATE TABLE public.test ( x text ); ALTER TABLE public.test OWNER TO postgres; -- -- Data for Name: test; Type: TABLE DATA; Schema: public; Owner: postgres -- COPY public.test (x) FROM stdin; \. -- -- Name: i_test; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX i_test ON public.test USING btree (public.upper2(x)); -- -- Name: i_test2; Type: INDEX; Schema: public; Owner: postgres -- CREATE INDEX i_test2 ON public.test USING btree (public.upper3(x)); -- -- PostgreSQL database dump complete --