X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 2FCC1D1B53B for ; Fri, 7 May 2004 06:58:52 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 97926-02 for ; Fri, 7 May 2004 06:58:34 -0300 (ADT) Received: from ara.zf.jcu.cz (ara.zf.jcu.cz [160.217.161.4]) by svr1.postgresql.org (Postfix) with ESMTP id 5E302D1EDCE for ; Fri, 7 May 2004 06:58:31 -0300 (ADT) Received: from ara.zf.jcu.cz (localhost [127.0.0.1]) by nod32.zf.jcu.cz (Postfix) with ESMTP id C71D89866; Fri, 7 May 2004 11:58:32 +0200 (CEST) X-Virus-Scanner: This message was checked by NOD32 Antivirus system NOD32 for Linux Mail Server. For more information on NOD32 Antivirus System, please, visit our website: http://www.nod32.com/ Received: by ara.zf.jcu.cz (Postfix, from userid 5770) id B5FC49876; Fri, 7 May 2004 11:58:32 +0200 (CEST) Date: Fri, 7 May 2004 11:58:32 +0200 From: Karel Zak To: Abdul Wahab Dahalan Cc: pgsql-sql@postgresql.org Subject: Re: Display format for column Message-ID: <20040507095832.GB621@zf.jcu.cz> References: <409B5205.5030803@mimos.my> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <409B5205.5030803@mimos.my> User-Agent: Mutt/1.3.28i X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/67 X-Sequence-Number: 17781 On Fri, May 07, 2004 at 05:08:21PM +0800, Abdul Wahab Dahalan wrote: > Hi there! > > How do we format column size for displaying data in postgresql. > for example my data type for customername is varchar(100) and I want to > display the first 25 chars. > How should I do that? "display" a data is a client problem only, but you can select part of string: # select substring('qwertyuiopasdfg' from 0 for 8); substring ----------- qwertyu or for your case: select substring(customername from 0 for 25) FROM yourtab; http://www.postgresql.org/docs/7.4/static/functions-string.html Karel -- Karel Zak http://home.zf.jcu.cz/~zakkr/