From: Philippe Lang <philippe.lang@attiksystem.ch>
To: Michael Fuhr <mike@fuhr.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: Plperlu function & backticks return value -> truncated?
Date: Wed, 13 Oct 2004 17:54:31 +0200
Message-ID: <6C0CF58A187DA5479245E0830AF84F42142C56@poweredge.attiksystem.ch> (raw)
Thanks! That's perfect... `ps -awfux | grep postgres` runs fine...
-----Message d'origine-----
De : Michael Fuhr [mailto:mike@fuhr.org]
Envoyé : mercredi, 13. octobre 2004 17:47
À : Philippe Lang
Cc : pgsql-sql@postgresql.org
Objet : Re: [SQL] Plperlu function & backticks return value -> truncated?
On Wed, Oct 13, 2004 at 05:07:05PM +0200, Philippe Lang wrote:
> When run directly from a shell, this code:
>
> $ps = `ps -afux | grep postgres`;
> @fields = split /\n/, $ps;
> return "{" . join(",", @fields) . "}";
>
> ... runs fine.
>
> But when run inside a plperlu function, lines are being truncated
> after a certain width.
Many versions of ps truncate lines at a certain length if they can't determine the terminal size. Since you're running ps from inside the backend, there's probably no terminal to check. Check the ps manual page to see if it supports an option like -w (or multiple occurrences of -w) to increase the line length.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: philippe.lang@attiksystem.ch, mike@fuhr.org
Subject: Re: Plperlu function & backticks return value -> truncated?
In-Reply-To: <6C0CF58A187DA5479245E0830AF84F42142C56@poweredge.attiksystem.ch>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox