Re: use pg_get_functiondef() in pg_dump

2020-08-26 Thread Peter Eisentraut
On 2020-08-15 16:23, Tom Lane 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 comman

Re: use pg_get_functiondef() in pg_dump

2020-08-26 Thread Peter Eisentraut
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

Re: use pg_get_functiondef() in pg_dump

2020-08-18 Thread Tom Lane
Stephen Frost writes: > So.. the code that's in pg_dump today works to go from "whatever the > connected server's version is" to "whatever the version is of the > pg_dump command itself". If we had the code in libpgcommon, and > functions in the backend to get at it along with psql having that c

Re: use pg_get_functiondef() in pg_dump

2020-08-18 Thread Stephen Frost
Greetings, * Corey Huinker (corey.huin...@gmail.com) wrote: > > I'm sure there's a lot of folks who'd like to see more of the logic we > > have in pg_dump for building objects from the catalog available to more > > tools through libpgcommon- psql being one of the absolute first > > use-cases for e

Re: use pg_get_functiondef() in pg_dump

2020-08-17 Thread Corey Huinker
> > I'm sure there's a lot of folks who'd like to see more of the logic we > have in pg_dump for building objects from the catalog available to more > tools through libpgcommon- psql being one of the absolute first > use-cases for exactly that (there's certainly no shortage of people > who've asked

Re: use pg_get_functiondef() in pg_dump

2020-08-15 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) 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 > > con

Re: use pg_get_functiondef() in pg_dump

2020-08-15 Thread Tom Lane
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,

Re: use pg_get_functiondef() in pg_dump

2020-08-15 Thread Tom Lane
Peter Eisentraut writes: > On 2020-08-12 21:54, Robert Haas wrote: >> One problem with this, which I think Tom pointed out before, is that >> it might make it to handle some forward-compatibility problems. In >> other words, if something that the server is generating needs to be >> modified for co

Re: use pg_get_functiondef() in pg_dump

2020-08-15 Thread Peter Eisentraut
On 2020-08-12 21:54, Robert Haas wrote: One problem with this, which I think Tom pointed out before, is that it might make it to handle some forward-compatibility problems. In other words, if something that the server is generating needs to be modified for compatibility with a future release, it'

Re: use pg_get_functiondef() in pg_dump

2020-08-12 Thread Robert Haas
On Wed, Aug 12, 2020 at 4:25 AM Peter Eisentraut wrote: > 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 func