Re: determine client os

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Greg Sabino Mullane <greg(at)turnstep(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: determine client os
Date: 2011-06-13 12:35:17
Message-ID: 20110613123517.GA6185@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jun 13, 2011 at 12:31:57PM -0000, Greg Sabino Mullane wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
>
>
> > Yep, or you can use a PL/Python, PL/Perl or PL/Java function that makes
> > the appropriate calls in that language. Any of these will probably
> > require the use of the "untrusted" (superuser-only) version.
>
> Nope, you can do this easily in trusted perl:
>
> CREATE OR REPLACE FUNCTION findos()
> RETURNS TEXT
> LANGUAGE plperl
> AS $$
> return $^O;
> $$;
>
> SELECT findos();
>
> findos
> - --------
> linux

Please note that it will return os for *server*, and not *client*.

Best regards,

depesz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message jonathansfl 2011-06-13 13:35:24 Re: Can't drop temp table in subfunction during cursor loop (being used by active queries)
Previous Message Greg Sabino Mullane 2011-06-13 12:31:57 Re: determine client os