Re: how to check if a database exists programatically

Поиск
Список
Период
Сортировка
От Devrim GUNDUZ
Тема Re: how to check if a database exists programatically
Дата
Msg-id 1134045284.21190.4.camel@linux.site
обсуждение исходный текст
Ответ на Re: how to check if a database exists programatically  (Devrim GUNDUZ <devrim@commandprompt.com>)
Список pgsql-general
Hi,

On Thu, 2005-12-08 at 14:20 +0200, Devrim GUNDUZ wrote:

> SELECT 1 from pg_database WHERE datname='abc';

Ah of course:

$ psql template1 -U postgres -c "SELECT 1 AS result FROM pg_database
WHERE datname='yapab'";
 result
--------
      1
(1 row)

$ psql template1 -U postgres -c "SELECT 1 AS result FROM pg_database
WHERE datname='abc'";

 result
--------
(0 rows)

and you can parse this output too.

--
The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/



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

Предыдущее
От: Devrim GUNDUZ
Дата:
Сообщение: Re: how to check if a database exists programatically
Следующее
От: Jens Carl
Дата:
Сообщение: Multi-Master-Solution (PGCluster)?