Re: Re: Test for existence of Table
От | Gregory Wood |
---|---|
Тема | Re: Re: Test for existence of Table |
Дата | |
Msg-id | 001f01c07743$94da42e0$7889ffcc@comstock.com обсуждение исходный текст |
Ответ на | RE: Re: Test for existence of Table ("Craig L. Ching" <cching@mqsoftware.com>) |
Список | pgsql-general |
> >> DROP TABLE employees > >Error: ERROR: Relation 'employees' does not exist > > > >And execution halts.... which is I believe why he wanted to check for the > >existence before trying to DROP. I'd love to know if this exists as well... > >would come in very handy during development time. > > Execution does not halt, it continues and creates the table. I rely on this > functionality, so I know it works. Good luck! Well, that is a quote from the database tool I use, and execution does indeed halt. I can only assume you are using psql, which someone confirmed that that does work. Also, if you wrap your queries in an explicit transaction (I don't like to leave anything to Auto-Commit), it will also fail: NOTICE: current transaction is aborted, queries ignored until end of transaction block What would be nice is if there were a way to only DROP a table if it exists. But I would consider this to be rather low priority. Greg
В списке pgsql-general по дате отправления: