Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id A26762E02A1 for ; Mon, 17 Dec 2007 14:50:25 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 97593-05 for ; Mon, 17 Dec 2007 14:50:10 -0400 (AST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by postgresql.org (Postfix) with ESMTP id 268592E005B for ; Mon, 17 Dec 2007 14:50:19 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id j3so1706308ugf.49 for ; Mon, 17 Dec 2007 10:50:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; bh=d19c4gpqbWcEwp42meVka3JXTaFN2EQ68TzGjZ/z4ec=; b=svwnzJ62BoTBMyQuNS9n9aKhBEw93wkIfPL309D6/bx9/fJVGOIonzsFDVy1DByw1gJ21wwmj9gGa1LNGWrcy3kNDI8e+vqU54HiZNpRsI1t/TEML7G3QGtIvz4DqXjuPNcIpso3llGpKnH7wv9zEWXhlDKFItk9Qay6VwRZKSA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=bdK9/kYVOwhCa7LR+/JMX/jfnOqVMNcCPVIGMO0mLtQAFiW9LIzI2pdBIPYtPszeAHGv80+8Xg3UM5DAAVsfISkPIYQFZdxMeZYDhjOrg+imSF/1QmuCHnN8o4zxwqD/Ydms9/emDKjKvZafuPw/ruEAUukIusnUw1JHnwOPlXY= Received: by 10.78.149.15 with SMTP id w15mr8809990hud.67.1197917418493; Mon, 17 Dec 2007 10:50:18 -0800 (PST) Received: by 10.78.77.20 with HTTP; Mon, 17 Dec 2007 10:50:18 -0800 (PST) Message-ID: Date: Mon, 17 Dec 2007 10:50:18 -0800 From: "Scott Abel" To: pgsql-admin@postgresql.org Subject: pg_dump --create --schema-only, how to suppress template1 functions ? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: 8d1971c863b781ca X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/144 X-Sequence-Number: 27661 I was using pg_dump --create --schema-only (or so I thought) to maintain source files for my database that I could check into my revision control system. Now I just tried to recreate the source file from an updated version of the DB, and I'm finding that it dumps all the built-in stuff from template1 (not stuff I added, AFAIK). The last file I checked in used template1 in the "CREATE DATABASE" statement and only had CREATE statements for functions and tables that I created in my database. All the stuff from template1 was then created implicitly by the template1 clause in the CREATE DATABASE statement. This is exactly the behavior I want. Here's the exact command line I used for 8.2.4 pg_dump in both cases (unless I'm mistaken and somehow I ran a different version of my script before): pg_dump -U postgres -H myhost --create --schema-only --encoding=UTF8 --file=myoutputfile mydbname Now when I try to run it (still with 8.2.4), the CREATE DATABASE statement generated uses template0 and then pg_dump regurgitates every function in my database, including those that came from template1. I don't use most of the functions and don't want them generated in the schema file; I really would like to figure out how to get back the old behavior of pg_dump generating a CREATE DATABASE statement that uses template1 as the template and only generates DDL for my tables and functions. How do I do this?