Re: [BUGS] Regarding copy of function from one db to another db - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: [BUGS] Regarding copy of function from one db to another db
Date
Msg-id CAKFQuwZ_qhvC6-j4VXoTkAab8c3v7vAHzHCYDskDZwpDe3xaWQ@mail.gmail.com
Whole thread Raw
In response to [BUGS] Regarding copy of function from one db to another db  (Rohit Dwivedi <dwivedir092@gmail.com>)
List pgsql-bugs
On Thu, Jun 15, 2017 at 3:43 AM, Rohit Dwivedi <dwivedir092@gmail.com> wrote:
Hello sir,
            if we need to copy all the functions of database to another database then how  we can implement it other then copy paste and run it...Because there are total 153 functions in our database.


​General questions should be directed to the pgsql-general@postgresql.org mailing list.

The tools provided to do what you want are pg_dump and pg_restore (specifically note the --list and --list-file options to pg_restore).  You will need to manually edit the list file to include only the functions as there is no object type filter capability (well, I now see there is a --function argument to pg_restore but I'm unsure about whether it take wildcards.  You will probably want to try it).  You can restrict the dump to schema only if you indeed only care about functions.

David J.

pgsql-bugs by date:

Previous
From: Anthony Sotolongo
Date:
Subject: Re: [BUGS] Regarding copy of function from one db to another db
Next
From: 厚积薄发
Date:
Subject: [BUGS] GIN index vacuum hang after pg_rman restore in PG9.2.21