Re: fieldwidths - Mailing list pgsql-general

From Tom Lane
Subject Re: fieldwidths
Date
Msg-id 9992.1048223870@sss.pgh.pa.us
Whole thread Raw
In response to fieldwidths  (ahoward <ahoward@fsl.noaa.gov>)
List pgsql-general
ahoward <ahoward@fsl.noaa.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Multiple backend connections
Next
From: "Shridhar Daithankar"
Date:
Subject: Re: Extracting time from timestamp