I cannot reproduce your problem.
When I specify the schema name, it regenerates in the pg_dump file for both of my test functions.
Below is my test dump of a quick test schema I created for this issue and as you can see, the schema names did not drop off.
PGDUMP COMMAND USED...
> pg_dump -n b -U postgres mydatabase > myfile.txt
-- Note 'b' was my schema name.
DUMP FILE RESULT...
--
-- PostgreSQL database dump
--
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
--
-- Name: b; Type: SCHEMA; Schema: -; Owner: postgres
--
CREATE SCHEMA b;
ALTER SCHEMA b OWNER TO postgres;
SET search_path = b, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: mytable; Type: TABLE; Schema: b; Owner: postgres; Tablespace:
--
CREATE TABLE mytable (
id integer DEFAULT nextval('ltjet_duediligence.datacomment_seq'::regclass) NOT NULL,
mytext character varying(14) DEFAULT 'NOTSET'::character varying NOT NULL
);
ALTER TABLE b.mytable OWNER TO postgres;
--
-- Name: myfunction(); Type: FUNCTION; Schema: b; Owner: postgres
--
CREATE FUNCTION myfunction() RETURNS character varying
AS $$
DECLARE
t_id varchar;
BEGIN
t_id = 'KT' || nextval('ltjet_duediligence.datacomment_seq'::regclass)::text;
RETURN t_id;
END;
$$
LANGUAGE plpgsql;
ALTER FUNCTION b.myfunction() OWNER TO postgres;
--
-- Name: myfunction2(); Type: FUNCTION; Schema: b; Owner: postgres
--
CREATE FUNCTION myfunction2() RETURNS character varying
AS $$
DECLARE
t_id varchar;
BEGIN
t_id = 'KT' || nextval('b.mytable_seq'::regclass)::text;
RETURN t_id;
END;
$$
LANGUAGE plpgsql;
ALTER FUNCTION b.myfunction2() OWNER TO postgres;
--
-- Name: mytable_seq; Type: SEQUENCE; Schema: b; Owner: postgres
--
CREATE SEQUENCE mytable_seq
START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE b.mytable_seq OWNER TO postgres;
--
-- Name: mytable_seq; Type: SEQUENCE SET; Schema: b; Owner: postgres
--
SELECT pg_catalog.setval('mytable_seq', 1, false);
--
-- Data for Name: mytable; Type: TABLE DATA; Schema: b; Owner: postgres
--
COPY mytable (id, mytext) FROM stdin;
\.
--
-- Name: mytable_pk; Type: CONSTRAINT; Schema: b; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY mytable
ADD CONSTRAINT mytable_pk PRIMARY KEY (id);
--
-- PostgreSQL database dump complete
--
Gary
gwinn7