getting column value length

Started by blackwater devabout 17 years ago3 messagesgeneral
Jump to latest
#1blackwater dev
blackwaterdev@gmail.com

I need to return all rows in a table where one of the columns 'name' is 37+
characters. In postgres, is there a function to get the length of the
columns contents?

Thanks!

#2Joshua D. Drake
jd@commandprompt.com
In reply to: blackwater dev (#1)
Re: getting column value length

On Tue, 2009-02-03 at 18:44 -0500, blackwater dev wrote:

I need to return all rows in a table where one of the columns 'name'
is 37+ characters. In postgres, is there a function to get the length
of the columns contents?

http://www.postgresql.org/docs/8.3/static/functions-string.html

length()

Thanks!

--
PostgreSQL - XMPP: jdrake@jabber.postgresql.org
Consulting, Development, Support, Training
503-667-4564 - http://www.commandprompt.com/
The PostgreSQL Company, serving since 1997

#3Thomas Kellerer
spam_eater@gmx.net
In reply to: blackwater dev (#1)
Re: getting column value length

blackwater dev wrote on 04.02.2009 00:44:

I need to return all rows in a table where one of the columns 'name' is
37+ characters. In postgres, is there a function to get the length of
the columns contents?

Check out char_length()

http://www.postgresql.org/docs/8.3/static/functions-string.html