Re: use pg_get_functiondef() in pg_dump

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: use pg_get_functiondef() in pg_dump
Date: 2020-08-26 11:13:22
Message-ID: 8a3c3af6-7725-ec07-9bc5-c6ca37a2594e@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-08-15 16:36, Tom Lane wrote:
> I wrote:
>> I wouldn't say that it's *fundamentally* new, but nonethless it disturbs
>> me that this proposal has pg_dump assembling CREATE FUNCTION commands in
>> very different ways depending on the server version. I'd rather see us
>> continuing to build the bulk of the command the same as before, and
>> introduce new behavior only for deparsing the function body.
>
> BTW, a concrete argument for doing it that way is that if you make a
> backend function that does the whole CREATE-FUNCTION-building job in
> exactly the way pg_dump wants it, that function is nigh useless for
> any other client with slightly different requirements. A trivial
> example here is that I don't think we want to become locked into
> the proposition that psql's \ef and \sf must print functions exactly
> the same way that pg_dump would.

That's why the patch adds optional arguments to the function to choose
the behavior that is appropriate for the situation.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2020-08-26 11:14:41 Re: use pg_get_functiondef() in pg_dump
Previous Message Peter Eisentraut 2020-08-26 11:00:57 Re: Allow CURRENT_ROLE in GRANTED BY