Re: Regarding copy of function from one db to another db

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Rohit Dwivedi <dwivedir092(at)gmail(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Regarding copy of function from one db to another db
Date: 2017-06-15 15:42:16
Message-ID: CAKFQuwZ_qhvC6-j4VXoTkAab8c3v7vAHzHCYDskDZwpDe3xaWQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Jun 15, 2017 at 3:43 AM, Rohit Dwivedi <dwivedir092(at)gmail(dot)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(at)postgresql(dot)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.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message 厚积薄发 2017-06-15 16:08:41 GIN index vacuum hang after pg_rman restore in PG9.2.21
Previous Message Anthony Sotolongo 2017-06-15 15:01:27 Re: Regarding copy of function from one db to another db