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

Поиск
Список
Период
Сортировка
Искать
От
hubert depesz lubaczewski
Тема
Re: Is there a "right" way to test if a database is empty?
Дата
Msg-id
20180118110424.GA1012@depesz.com
Ответ на
Список
Дерево обсуждения
Is there a "right" way to test if a database is empty? Graham Leggett <minfrin@sharp.fm>
Re: Is there a "right" way to test if a database is empty? pinker <pinker@onet.eu>
Re: Is there a "right" way to test if a database is empty? Graham Leggett <minfrin@sharp.fm>
Re: Is there a "right" way to test if a database is empty? Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Is there a "right" way to test if a database is empty? hubert depesz lubaczewski <depesz@depesz.com>
Re: Is there a "right" way to test if a database is empty? Graham Leggett <minfrin@sharp.fm>
Re: Is there a "right" way to test if a database is empty? "David G. Johnston" <david.g.johnston@gmail.com>
Re: Is there a "right" way to test if a database is empty? Graham Leggett <minfrin@sharp.fm>
Re: Is there a "right" way to test if a database is empty? "David G. Johnston" <david.g.johnston@gmail.com>
On Wed, Jan 17, 2018 at 05:47:16PM +0200, Graham Leggett wrote:
> I need to test whether a database is empty, in other words “createdb”
> has been executed but no data of any kind appears in that database.
> What is the correct postgresql way to do this?

There is none, because it highly depends on how you'll define empty.

Please note that even directly after "create database x;" your db might
not be empty, if you had some things created earlier in template1.

Best regards,

depesz


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