Re: CREATE DATABASE IF NOT EXISTS in PostgreSQL

Поиск
Список
Период
Сортировка
Искать
От
Japin Li
Тема
Re: CREATE DATABASE IF NOT EXISTS in PostgreSQL
Дата
Msg-id
MEYP282MB1669A6D5FD725BE31EAE844AB6019@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Ответ на
Список
Дерево обсуждения
CREATE DATABASE IF NOT EXISTS in PostgreSQL Japin Li <japinli@hotmail.com>
Re: CREATE DATABASE IF NOT EXISTS in PostgreSQL Tom Lane <tgl@sss.pgh.pa.us>
Re: CREATE DATABASE IF NOT EXISTS in PostgreSQL Japin Li <japinli@hotmail.com>

On Mon, 28 Feb 2022 at 01:53, Tom Lane  wrote:
> Japin Li  writes:
>> Why don't support CREATE DATABASE IF NOT EXISTS syntax in PostgreSQL?
>
> FWIW, I'm generally hostile to CREATE IF NOT EXISTS semantics across
> the board, because of its exceedingly squishy semantics: it ensures
> that an object by that name exists, but you have exactly no guarantees
> about its properties or contents.

Thanks for the explanation!  I think it is the database user who should
guarantee the properties and contents of a database.
CREATE IF NOT EXISTS is just a syntax sugar.

-- 
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.


В списке pgsql-hackers по дате отправления
От: Thomas Munro
Дата:
От: Masahiko Sawada
Дата:
FAQ