Re: Truncate if exists
От | Andrew Dunstan |
---|---|
Тема | Re: Truncate if exists |
Дата | |
Msg-id | 5078440F.4090906@dunslane.net обсуждение исходный текст |
Ответ на | Re: Truncate if exists (Sébastien Lardière <slardiere@hi-media.com>) |
Ответы |
Re: Truncate if exists
|
Список | pgsql-hackers |
On 10/12/2012 12:03 PM, Sébastien Lardière wrote: > > If we can do something like : > > SELECT pg_if_table_exists('bar' , pg_if_table_exists('foo', 'TRUNCATE > TABLE foo, bar, foobar')) ; > > or > > SELECT pg_if_tables_exists('TRUNCATE TABLE foo, bar, foobar', 'foo', > 'bar') ; > > I say yes ! > > This strikes me as just highly un-SQL-like. Someone could fairly easily write it for themselves in Plpgsql or C, but it doesn't seem to me like something we should be doing. I tend to agree with Noah's comment upthread: > But the syntax is a bandage for raw psql input remaining a hostile > environment for implementing the full range of schema changes. Switch to > submitting your SQL from a richer programming environment, and these additions > to core syntax cease to add much. I think this goes a fortiori for Heath Robinson-like devices such as this. cheers andrew
В списке pgsql-hackers по дате отправления: