X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7520B475AD7 for ; Tue, 18 Feb 2003 13:28:35 -0500 (EST) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by postgresql.org (Postfix) with ESMTP id B8F04475AA9 for ; Tue, 18 Feb 2003 13:28:34 -0500 (EST) Received: from [66.219.92.2] (HELO chocolate-mousse) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 2845586; Tue, 18 Feb 2003 10:28:40 -0800 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Jan Wieck , Mintoo Lall Subject: Re: Drop temporary table only if it exists Date: Tue, 18 Feb 2003 10:28:01 -0800 X-Mailer: KMail [version 1.4] Cc: pgsql-sql@postgresql.org References: <20030214153413.24680.qmail@web14802.mail.yahoo.com> <3E526F86.69391A03@Yahoo.com> In-Reply-To: <3E526F86.69391A03@Yahoo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200302181028.01599.josh@agliodbs.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/413 X-Sequence-Number: 11811 Jan, > > How do I drop a temporary table ( or for that matter a sequence) only > > if it exists or create them if they donot exist ? I want to do this > > to avoid any errors >=20 > I wonder what type of application cannot remember if it created a temp > object or not during the lifetime of it's database connection. A real one, Jan. This sort of test is particularly necessary for Exception handling routines= .=20=20=20 One wants the exception handler to drop all temporary obejcts for a clean= =20 slate, but since an exception has occurred, one cannot be sure which object= s=20 were created successfully. I've personally written several such routines.=20=20 --=20 -Josh Berkus Aglio Database Solutions San Francisco