pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Philippe Lang <philippe.lang@attiksystem.ch>
Cc: pgsql-sql@postgresql.org
Subject: Re: Plperlu function & backticks return value -> truncated?
Date: Wed, 13 Oct 2004 09:47:13 -0600
Message-ID: <20041013154712.GB69936@winnie.fuhr.org> (raw)
In-Reply-To: <6C0CF58A187DA5479245E0830AF84F42142C54@poweredge.attiksystem.ch>
References: <6C0CF58A187DA5479245E0830AF84F42142C54@poweredge.attiksystem.ch>

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/



view thread (5+ messages)  latest in thread

Message-ID: <20041013154712.GB69936@winnie.fuhr.org>
Permalink:  ../20041013154712.GB69936@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20041013154712.GB69936@winnie.fuhr.org

 · 

reply

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: mike@fuhr.org, philippe.lang@attiksystem.ch
  Subject: Re: Plperlu function & backticks return value -> truncated?
  In-Reply-To: <20041013154712.GB69936@winnie.fuhr.org>

* 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