Re: Plperlu function & backticks return value -> truncated?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Philippe Lang <philippe(dot)lang(at)attiksystem(dot)ch>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Plperlu function & backticks return value -> truncated?
Date: 2004-10-13 15:47:13
Message-ID: 20041013154712.GB69936@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Philippe Lang 2004-10-13 15:54:31 Re: Plperlu function & backticks return value -> truncated?
Previous Message Philippe Lang 2004-10-13 15:42:10 Re: Plperlu function & backticks return value -> truncated?