Re: Is there a "right" way to test if a database is empty?

Поиск
Список
Период
Сортировка
От Graham Leggett
Тема Re: Is there a "right" way to test if a database is empty?
Дата
Msg-id 5B09CFC6-EE9D-4483-84B6-FB1393CD3041@sharp.fm
обсуждение исходный текст
Ответ на Re: Is there a "right" way to test if a database is empty?  (pinker <pinker@onet.eu>)
Список pgsql-hackers
On 17 Jan 2018, at 6:01 PM, pinker <pinker@onet.eu> wrote:

I always do: \l+ and then you can compare the size: new_one | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | 7869 kB | pg_default | template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +| 7869 kB | pg_default | | | | | postgres=CTc/postgres | | | template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +| 7869 kB | pg_default

What I am after is something scriptable and data safe.

The size isn’t something I would be comfortable relying on.

Regards,
Graham

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: pinker
Дата:
Сообщение: Re: Is there a "right" way to test if a database is empty?
Следующее
От: Corey Huinker
Дата:
Сообщение: Re: CREATE ROUTINE MAPPING