use pg_get_functiondef() in pg_dump

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: use pg_get_functiondef() in pg_dump
Date: 2020-08-12 08:25:31
Message-ID: 9df8a3d3-13d2-116d-26ab-6a273c1ed38c@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here is a patch to have pg_dump use pg_get_functiondef() instead of
assembling the CREATE FUNCTION/PROCEDURE commands itself. This should
save on maintenance effort in the future. It's also a prerequisite for
being able to dump functions with SQL-standard function body discussed
in [0].

pg_get_functiondef() was meant for psql's \ef command, so its defaults
are slightly different from what pg_dump would like, so this adds a few
optional parameters for tweaking the behavior. The naming of the
parameters is up for discussion.

[0]:
https://www.postgresql.org/message-id/flat/1c11f1eb-f00c-43b7-799d-2d44132c02d7(at)2ndquadrant(dot)com

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
v1-0001-Drop-final-newline-from-pg_get_functiondef-result.patch text/plain 4.8 KB
v1-0002-pg_dump-Use-pg_get_functiondef.patch text/plain 14.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Wilm Hoyer 2020-08-12 09:35:04 AW: posgres 12 bug (partitioned table)
Previous Message Marco Atzeri 2020-08-12 08:18:00 Re: remove some ancient port hacks