Thanks Steve.  Great idea.  Unfortunately, I don't think it helps me now (unless I want to reload 70 or so datasets.)  
I'll keep it in mind for other databases. <div><br></div><div>I'm still learning postgis but how do you keep the functions in the data schema if the database is created (with functions) before that schema?  Or should all the functions stay in the public schema and datasets in the "data" schema?  Thanks for any help.<div>
<br clear="all"><div>- John</div><div><br></div><div><br></div><br>
<br><br><div class="gmail_quote">On Thu, Mar 22, 2012 at 8:11 PM, Stephen Woodbridge <span dir="ltr"><<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This is why I ALWAYS build my databases and create a data schema than set the search path to "data, public". Then all my functions and data go into "data" and I can pg_dump -N public to leave behind all the postgis stuff.<br>

<br>
createdb -T template_postgis mydb<br>
psql mydb -c "create schema data; alter database mydb set search_path to data, public"<br>
...<br>
pg_dump ... -f mydb.dump -N public mydb<br>
<br>
Never have to worry about that again.<br>
<br>
-Steve<div class="im"><br>
<br>
On 3/22/2012 8:02 PM, John Callahan wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Well, that makes sense.  I was using the --data-only option because I<br>
did not want to bring over the functions (since the functions already<br>
exist in the new database through the postgis creation script.)<br>
<br>
Is there a way to dump/restore only the data tables (including create<br>
statements, indexes,  sequences, privileges) and not the functions or<br>
function comments?  I ran into a problem recently while upgrading when I<br>
had too many similar functions and postgis couldn't determine a unique<br>
function at times.<br>
<br>
- John<br>
<br>
******************************<u></u>*****************<br>
John Callahan, Research Scientist<br>
Delaware Geological Survey, University of Delaware<br>
URL: <a href="http://www.dgs.udel.edu" target="_blank">http://www.dgs.udel.edu</a><br>
******************************<u></u>*******************<br>
<br>
<br>
<br>
On Thu, Mar 22, 2012 at 7:17 PM, Bborie Park <<a href="mailto:bkpark@ucdavis.edu" target="_blank">bkpark@ucdavis.edu</a><br></div><div><div></div><div class="h5">
<mailto:<a href="mailto:bkpark@ucdavis.edu" target="_blank">bkpark@ucdavis.edu</a>>> wrote:<br>
<br>
    The pg_dump call is called with "--data-only" so you're not getting<br>
    any table creation information.  And since the new DB doesn't have<br>
    any tables, restoring the data will result in an error.<br>
<br>
    -bborie<br>
<br>
<br>
    On 03/22/2012 04:14 PM, John Callahan wrote:<br>
<br>
        I having a problem with something that is usually straight<br>
        forward. I am<br>
        moving a database from a Windows 2003 Server box to Windows 2008<br>
        Server.<br>
          Both are x64 but running 32bit Postgres 9.0.7.  The<br>
        new/destination<br>
        database runs the latest postgis 2.0 binaries (from March 19 or<br>
        so) and the<br>
        source/older database runs postgis 2.0 libraries from a few<br>
        months ago.<br>
<br>
        On the new db, I installed postgres 9.0.7, then postgis 2.0<br>
        latest build,<br>
        which created my database.  Of course, the database does not<br>
        have any<br>
        tables at this point (just the functions, a few views.)<br>
<br>
        I run pg_dump on the source db as so:<br>
        pg_dump.exe --host localhost --port 5432 --username "username"<br>
        --role<br>
        "myrole"  --format plain --data-only --verbose --file<br>
        "C:\temp\webdata_20120315.sql" "mydb"<br>
<br>
        When I try to run the resulting sql on the new server, I get the<br>
        following<br>
        error:<br>
        ERROR: relation<table_name>  does not exist<br>
<br>
        If I use --inserts options in pg_dump, I still get the "relation<br>
        does not<br>
        exist error"   If I use pgAdmin to backup and restore (using the tar<br>
        format), the error is the same.<br>
<br>
        What am I missing?   Thanks.<br>
<br>
        - John<br>
<br>
        ****************************** *****************<br></div></div><div class="im">
        John Callahan, Research Scientist<br>
        Delaware Geological Survey, University of Delaware<br>
        URL: <a href="http://www.dgs.udel.edu" target="_blank">http://www.dgs.udel.edu</a><br>
        ****************************** *******************<br>
<br>
<br>
<br>
<br></div>
        ______________________________ _________________<br>
        postgis-users mailing list<br>
        postgis-users@postgis. <a href="http://refractions.net" target="_blank">refractions.net</a><br>
        <mailto:<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.<u></u>refractions.net</a>><br>
        <a href="http://postgis.refractions" target="_blank">http://postgis.refractions</a>. net/mailman/listinfo/postgis- users<div class="im"><br>
        <<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.<u></u>net/mailman/listinfo/postgis-<u></u>users</a>><br>
<br>
<br>
    --<br>
    Bborie Park<br>
    Programmer<br>
    Center for Vectorborne Diseases<br>
    UC Davis<br></div>
    <a href="tel:530-752-8380" value="+15307528380" target="_blank">530-752-8380</a> <tel:<a href="tel:530-752-8380" value="+15307528380" target="_blank">530-752-8380</a>><br>
    <a href="mailto:bkpark@ucdavis.edu" target="_blank">bkpark@ucdavis.edu</a> <mailto:<a href="mailto:bkpark@ucdavis.edu" target="_blank">bkpark@ucdavis.edu</a>><br>
    ______________________________ _________________<br>
    postgis-users mailing list<br>
    postgis-users@postgis. <a href="http://refractions.net" target="_blank">refractions.net</a><br>
    <mailto:<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.<u></u>refractions.net</a>><br>
    <a href="http://postgis.refractions" target="_blank">http://postgis.refractions</a>. net/mailman/listinfo/postgis- users<br>
    <<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.<u></u>net/mailman/listinfo/postgis-<u></u>users</a>><div class="im"><br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.<u></u>refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.<u></u>net/mailman/listinfo/postgis-<u></u>users</a><br>
</div></blockquote><div><div></div><div class="h5">
<br>
______________________________<u></u>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.<u></u>refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.<u></u>net/mailman/listinfo/postgis-<u></u>users</a><br>
</div></div></blockquote></div><br></div></div>