I'm moving a PostgreSQL cluster from one server to another, and in the process also moving from 7.4 to 8.1. On the home server I have a template database called template_postgis that I used to create a couple other databases.  According to the PostgreSQL docs, changes made to a template will be effected on databases created from that template.  I'm curious how, if at all, this relationship is maintained through a pg_dump and pg_restore?  In particular, let's say I have template "A" and I create database "B" from it.  If I want to dump "B" and restore it elsewhere, will the dump of "B" include all of the functions / types that it inherits from "A", or for to maintain functionality do I need to dump and restore "A" first, then "B" afterwards?

I've looked through the docs on pg_dump and pg_restore but I wasn't able to find the answers to this.

Thank you,
Mark