Re: is max connections in a database table somewhere

From: Diego Augusto Molina <diegoaugustomolina(at)gmail(dot)com>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: is max connections in a database table somewhere
Date: 2011-08-11 17:14:25
Message-ID: CAGOxLdHwJkcqLg8ZCT_qYAMi2zPVEBc_8+qtkF659rXsP6Bjzg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2011/8/10, Greg Smith <greg(at)2ndquadrant(dot)com>:
> On 08/10/2011 02:46 PM, Geoffrey Myers wrote:
>> Is the max connections value in a system table somewhere?

Yes, it is in the table "pg_catalog.pg_database". The column is named
"datconnlimit" and is of type "int4". See this:
http://www.postgresql.org/docs/9.0/interactive/catalog-pg-database.html.

But this would be the appropiate way of getting the value:
> SELECT CAST(current_setting('max_connections') AS integer);

You would rather use that form instead of messing up with the catalogs.
--
Diego Augusto Molina
diegoaugustomolina(at)gmail(dot)com

ES: Por favor, evite adjuntar documentos de Microsoft Office. Serán
desestimados.
EN: Please, avoid attaching Microsoft Office documents. They shall be discarded.
LINK: http://www.gnu.org/philosophy/no-word-attachments.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Louis-David Mitterrand 2011-08-11 17:27:42 FK violation on (emtpy) parent table
Previous Message Joshua D. Drake 2011-08-11 16:26:18 Final 48 for PgWest CFP