pgschema icon indicating copy to clipboard operation
pgschema copied to clipboard

Table functions are not dumped

Open whoward opened this issue 1 year ago • 1 comments

It looks like the body of a table function is not dumped by pgschema dump. Here is an example:

CREATE FUNCTION days_since_special_date() RETURNS SETOF timestamptz
    LANGUAGE sql STABLE PARALLEL SAFE
    RETURN generate_series(date_trunc('day', '2025-01-01'::timestamp), date_trunc('day', NOW()), '1 day'::interval);

When you run pgschema dump on this database you get the following output:

--
-- pgschema database dump
--

-- Dumped from database version PostgreSQL 17.0
-- Dumped by pgschema version 1.4.0


--
-- Name: days_since_special_date; Type: FUNCTION; Schema: -; Owner: -
--

CREATE OR REPLACE FUNCTION days_since_special_date()
RETURNS SETOF timestamp with time zone
LANGUAGE sql
SECURITY INVOKER
STABLE
AS $$
$$;

whoward avatar Oct 20 '25 14:10 whoward

just tested, this works great! thanks for taking care of this.

whoward avatar Oct 23 '25 14:10 whoward