Re: determine client os

Поиск
Список
Период
Сортировка
От Greg Smith
Тема Re: determine client os
Дата
Msg-id 4DF6F29A.8030301@2ndQuadrant.com
обсуждение исходный текст
Ответ на determine client os  (Sim Zacks <sim@compulab.co.il>)
Список pgsql-general
On 06/13/2011 07:04 AM, Sim Zacks wrote:
> I didn't see a function for this, but is there a way in a postgresql
> query to determine the client OS?

A PostgreSQL client application is something that speaks a correct
protocol to the server.  The server has no concept of what the client is
other than the fact that it speaks a particular version of its
language.  It knows the IP address and port number it connected on, but
that's basically it.  So the idea of a query determining the client OS
doesn't make sense; all it knows is what the client tells it, and the
information required to connect to the server and execute queries does
not include any such details.

If you want information about a client to make its way into a statement
run on the server, you have to drive that from the direction of the
client you're using yourself.  If your client is psql for example, you
might pass client-side information into the program by using the
-v/--set/--variable substitution mechanism, possibly combined with the
SQL interpolation facility of psql.  But if your client program is in
another programming language, you'll have to use some facility in it to
fill in this information.

--
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books


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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: PGP encrypt/decrypt - Prereqistes
Следующее
От: AI Rumman
Дата:
Сообщение: system command in dblink?