vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have a database of several million records and we are currently developing pl functions and views. How do you dump only the code for views and functions? Benjamin ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org |
| |||
| On Wed, Dec 07, 2005 at 10:53:37PM -0800, Benjamin Arai wrote: > I have a database of several million records and we are currently > developing pl functions and views. How do you dump only the code for > views and functions? pg_dump doesn't allow you to be that selective, but you could use the --schema-only option to dump everything except the data. If you use one of the non-text dump formats then you could selectively restore objects with pg_restore. See the pg_restore documentation for the -l/--list and -L/--use-list options and the example near the bottom of the page. Some people maintain the code for functions and views outside the database, perhaps under a version control system, and then reload it when they make changes. -- Michael Fuhr ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend |
| |||
| Benjamin Arai wrote: > I have a database of several million records and we are currently > developing pl functions and views. How do you dump only the code for > views and functions? > > Benjamin > This has come up before, if you search the archives, you'll find various ways of accomplishing this. Here's a start (one way of getting function source) http://archives.postgresql.org/pgsql...0/msg01633.php ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq |
| ||||
| Benjamin Arai wrote: > I have a database of several million records and we are currently > developing pl functions and views. How do you dump only the code for > views and functions? > > Benjamin > Also, one way of recreating views: select 'drop view '||viewname||'; CREATE OR REPLACE view '||viewname||' as '||definition||'\n' from pg_views where schemaname='public'; ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster |