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

From: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: How to obtain the max length of a varchar(50) field.
Date: 2011-05-05 09:03:40
Message-ID: 20110505090339.GA16334@tux
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Mauro Ziliani 2011-05-05 10:09:34 Re: How to obtain the max length of a varchar(50) field.
Previous Message Simon Riggs 2011-05-05 09:03:36 Re: How to obtain the max length of a varchar(50) field.