Hi David,
David Link wrote:
> Hi All,
>
> Here's a Conditional drop_table func for those interested. There was a
> thread on this a long time back.
>
> We do this all the time :
>
> DELETE TABLE sales;
> CREATE TABLE sales (...);
>
Hm. "all the time" enables all the warning lights -
what are you doing to have to delete and create
the tables every time?
> But nobody likes
>
> ERROR: table "sales" does not exist
>
> which we see all the time in the logs. I want to show the logs to none
> db folk -- so we can't have those error messages in it.
grep -v "ERROR" should do it.
>
> (There must be some explaination why postgresql (and Oracle as well) do
> not have CREATE OR REPLACE TABLE as it does for VIEWs, and FUNCTIONs.
> Anybody know?)
Nobody needs this?
There is:
1) delete from table;
2) truncate table;
to remove all the data
3) alter table ...
to change tables layout.
HTH
Tino Wildenhain