Re: fieldwidths

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ahoward <ahoward(at)fsl(dot)noaa(dot)gov>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: fieldwidths
Date: 2003-03-21 05:17:50
Message-ID: 9992.1048223870@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

ahoward <ahoward(at)fsl(dot)noaa(dot)gov> writes:
> i've looked through to docs a bit, but have not found a way to quickly
> calculate the maximum fieldwidth of each field in a tuple set.

There is no general-purpose method for doing that.

> obviously psql does something internally to do it's formatting, but whatever
> it does is very fast... any ideas?

psql runs through the actual strings returned by the query and takes the
max length in each column. Not very brilliant ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shridhar Daithankar<shridhar_daithankar@persistent.co.in> 2003-03-21 05:57:53 Re: Extracting time from timestamp
Previous Message Tom Lane 2003-03-21 05:09:00 Re: Multiple backend connections