pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Mariya Yuniarti <mariya_yuniarti@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: ask syntax sql to get length of field
Date: Thu, 20 Apr 2006 10:23:48 -0500
Message-ID: <20060420152348.GA11024@wolff.to> (raw)
In-Reply-To: <20060420073708.83452.qmail@web33514.mail.mud.yahoo.com>
References: <20060420073708.83452.qmail@web33514.mail.mud.yahoo.com>

On Thu, Apr 20, 2006 at 00:37:08 -0700,
  Mariya Yuniarti <mariya_yuniarti@yahoo.com> wrote:
> Here Question :
> 
> I have table A with structure :
> 
>         Number         Character(20),
>        Description   Character(50)
> 
> I want to get length of field Number (20)
> 
> What is syntax sql to get length of field ?

Are you looking to get 20 or the length of a particular string in that column?
If you are looking for the maximum length (20), that should be available in
the catalogs. For the string length you can look in the string functions
section of the document. I am not sure whether or not trailing spaces are
counted in char columns. varchar makes more sense if you actually have
variable length strings.



view thread (2+ messages)

Message-ID: <20060420152348.GA11024@wolff.to>
Permalink:  ../20060420152348.GA11024@wolff.to/
Also on:    postgresql.org/message-id/20060420152348.GA11024@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bruno@wolff.to, mariya_yuniarti@yahoo.com
  Subject: Re: ask syntax sql to get length of field
  In-Reply-To: <20060420152348.GA11024@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox