X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9797632BD8E for ; Wed, 13 Oct 2004 16:47:27 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 35207-06 for ; Wed, 13 Oct 2004 15:47:23 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 0260B32BCD8 for ; Wed, 13 Oct 2004 16:47:22 +0100 (BST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id i9DFlDG9023320 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 13 Oct 2004 09:47:15 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id i9DFlD7Y070042; Wed, 13 Oct 2004 09:47:13 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id i9DFlDDx070041; Wed, 13 Oct 2004 09:47:13 -0600 (MDT) (envelope-from mfuhr) Date: Wed, 13 Oct 2004 09:47:13 -0600 From: Michael Fuhr To: Philippe Lang Cc: pgsql-sql@postgresql.org Subject: Re: Plperlu function & backticks return value -> truncated? Message-ID: <20041013154712.GB69936@winnie.fuhr.org> References: <6C0CF58A187DA5479245E0830AF84F42142C54@poweredge.attiksystem.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6C0CF58A187DA5479245E0830AF84F42142C54@poweredge.attiksystem.ch> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/93 X-Sequence-Number: 19196 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/