pgschema
pgschema copied to clipboard
Table functions are not dumped
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 $$
$$;
just tested, this works great! thanks for taking care of this.