Re: temp table existence

From: Erik Jones <erik(at)myemma(dot)com>
To: Marcin Krawczyk <jankes(dot)mk(at)gmail(dot)com>
Cc: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: temp table existence
Date: 2007-12-30 06:26:08
Message-ID: 429CBCF5-217F-49A9-959B-9D20CA7CC64C@myemma.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Dec 29, 2007, at 3:16 PM, Marcin Krawczyk wrote:

> I just realized something... my bad. It will work since TRUNCATE
> removes only table from current session.

If the table exists and you're going to TRUNCATE it before using it,
you could just use DROP TABLE IF EXISTS and then create it. I don't
know, that feels cleaner to me than TRUNCATEing a table that might
not be available to the session.

Erik Jones

Software Developer | Emma®
erik(at)myemma(dot)com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Pavel Stehule 2007-12-30 08:44:46 Re: temp table existence
Previous Message Adrian Klaver 2007-12-29 22:25:23 Re: temp table existence