Received: from oddjob.adhesivemedia.com (oddjob.adhesivemedia.com [207.202.159.77]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f63Md1a20054 for ; Tue, 3 Jul 2001 18:39:01 -0400 (EDT) (envelope-from philip@adhesivemedia.com) Received: from localhost (philip@localhost) by oddjob.adhesivemedia.com (8.11.1/8.11.1) with ESMTP id f63Mcs194897; Tue, 3 Jul 2001 15:38:54 -0700 (PDT) (envelope-from philip@adhesivemedia.com) Date: Tue, 3 Jul 2001 15:38:54 -0700 (PDT) From: Philip Hallstrom To: Jason Watkins cc: Subject: Re: drop table if exists In-Reply-To: <018b01c10406$8bcbaae0$426f2a40@boondocksaint> Message-ID: <20010703153823.P89242-100000@oddjob.adhesivemedia.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200107/32 X-Sequence-Number: 3813 Just drop the table using "DROP TABLE mytable;" and ignore the error... I'm sure there are fancy ways of doing it by accessing system tables, but the above works for me. On Tue, 3 Jul 2001, Jason Watkins wrote: > How can I duplicate the behavior of: > > DROP TABLE IF EXISTS mytable; > > CREATE TABLE mytable ( > blah, > blah > ); > > INSERT INTO mytable > (blah) > VALUES > (blah); > > in other words, so that I have a single sql file that restores the database > to a known state. > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://www.postgresql.org/search.mpl >