Fastest way to check database's existence

Поиск
Список
Период
Сортировка
От Kynn Jones
Тема Fastest way to check database's existence
Дата
Msg-id AANLkTin-hJvD6Li6mg7P80+vxAx5Efg+T5Wv-Tnvocxh@mail.gmail.com
обсуждение исходный текст
Ответы Re: Fastest way to check database's existence  (Peter Geoghegan <peter.geoghegan86@gmail.com>)
Re: Fastest way to check database's existence  (Raymond O'Donnell <rod@iol.ie>)
Re: Fastest way to check database's existence  (Adrian Klaver <adrian.klaver@gmail.com>)
Список pgsql-general
I want to code a Perl function (part of a Perl library) for determining the existence of a particular database (in a given host/port).

One way would be to just attempt making a connection to it, trapping any errors upon failure (with eval), or discarding the connection upon success.

This approach has the added benefit of also checking the accessibility of the database to the user running the code, but for this application this added benefit is not necessary.  Checking existence is all that matters.

Is there an even faster way to check for a database's existence that does not require establishing a connection?

(Maybe this question would be more suitable for the pgsql-performance list?)

TIA!

~kynn


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Request for comment: pgjson project
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Fastest way to check database's existence