Skip site navigation (1) Skip section navigation (2)

Re: How to obtain the max length of a varchar(50) field.

From: Mauro Ziliani <mauro(at)faresoftware(dot)it>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: How to obtain the max length of a varchar(50) field.
Date: 2011-05-05 10:10:51
Message-ID: 4DC277AB.6090206@faresoftware.it (view raw or flat)
Thread:
Lists: pgsql-novice
On 05/05/2011 11:03, Andreas Kretschmer wrote:
> Mauro Ziliani<mauro(at)faresoftware(dot)it>  wrote:
>
>> Hi all.
>> I'm working with Postgres 9.0 and wxWidgets.
>> I need to query the db about a field of a table.
>>
>> The table T has a field varchar(50).
>>
>> table: TAB0
>> customer: varchar(50)
>>
>> How can I get the max size of the field?
> select max(length(customer)) from tab0;
>
>
>
> Andreas
Thank you for the suggestion.
But I look a C function which access PGresult record.

This is usefull for an sql script.
Thank you very much.

MZ



In response to

pgsql-novice by date

Next:From: Grzegorz SzpetkowskiDate: 2011-05-05 12:14:02
Subject: Re: Looking for table in PostregSQL that contains Operating System and Processor information
Previous:From: Mauro ZilianiDate: 2011-05-05 10:09:34
Subject: Re: How to obtain the max length of a varchar(50) field.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group